/* Driver template for the LEMON parser generator.
** The author disclaims copyright to this source code.
*/
/* First off, code is included that follows the "include" declaration
** in the input grammar file. */
#include <stdio.h>
#line 53 "parse.y"

#include "sqliteInt.h"

/*
** An instance of this structure holds information about the
** LIMIT clause of a SELECT statement.
*/
struct LimitVal {
  Expr *pLimit;    /* The LIMIT expression.  NULL if there is no limit */
  Expr *pOffset;   /* The OFFSET expression.  NULL if there is none */
};

/*
** An instance of this structure is used to store the LIKE,
** GLOB, NOT LIKE, and NOT GLOB operators.
*/
struct LikeOp {
  Token eOperator;  /* "like" or "glob" or "regexp" */
  int not;         /* True if the NOT keyword is present */
};

/*
** An instance of the following structure describes the event of a
** TRIGGER.  "a" is the event type, one of TK_UPDATE, TK_INSERT,
** TK_DELETE, or TK_INSTEAD.  If the event is of the form
**
**      UPDATE ON (a,b,c)
**
** Then the "b" IdList records the list "a,b,c".
*/
struct TrigEvent { int a; IdList * b; };

/*
** An instance of this structure holds the ATTACH key and the key type.
*/
struct AttachKey { int type;  Token key; };

#line 46 "parse.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
/* 
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** understands. 
**
** Each symbol here is a terminal symbol in the grammar.
*/
/* Make sure the INTERFACE macro is defined.
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/* The next thing included is series of defines which control
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used for storing terminal
**                       and nonterminal numbers.  "unsigned char" is
**                       used if there are fewer than 250 terminals
**                       and nonterminals.  "int" is used otherwise.
**    YYNOCODE           is a number of type YYCODETYPE which corresponds
**                       to no legal terminal or nonterminal number.  This
**                       number is used to fill in empty slots of the hash 
**                       table.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       have fall-back values which should be used if the
**                       original value of the token will not parse.
**    YYACTIONTYPE       is the data type used for storing terminal
**                       and nonterminal numbers.  "unsigned char" is
**                       used if there are fewer than 250 rules and
**                       states combined.  "int" is used otherwise.
**    sqlite3ParserTOKENTYPE     is the data type used for minor tokens given 
**                       directly to the parser from the tokenizer.
**    YYMINORTYPE        is the data type used for all minor tokens.
**                       This is typically a union of many types, one of
**                       which is sqlite3ParserTOKENTYPE.  The entry in the union
**                       for base tokens is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
**                       zero the stack is dynamically sized using realloc()
**    sqlite3ParserARG_SDECL     A static variable declaration for the %extra_argument
**    sqlite3ParserARG_PDECL     A parameter declaration for the %extra_argument
**    sqlite3ParserARG_STORE     Code to store %extra_argument into yypParser
**    sqlite3ParserARG_FETCH     Code to extract %extra_argument from yypParser
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
*/
#define YYCODETYPE unsigned char
#define YYNOCODE 251
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 62
#define sqlite3ParserTOKENTYPE Token
typedef union {
  int yyinit;
  sqlite3ParserTOKENTYPE yy0;
  struct LimitVal yy64;
  Expr* yy122;
  Select* yy159;
  IdList* yy180;
  struct {int value; int mask;} yy207;
  struct LikeOp yy318;
  TriggerStep* yy327;
  SrcList* yy347;
  int yy392;
  struct TrigEvent yy410;
  ExprList* yy442;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define sqlite3ParserARG_SDECL Parse *pParse;
#define sqlite3ParserARG_PDECL ,Parse *pParse
#define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse
#define sqlite3ParserARG_STORE yypParser->pParse = pParse
#define YYNSTATE 610
#define YYNRULE 319
#define YYFALLBACK 1
#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)

/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */
static const YYMINORTYPE yyzerominor = { 0 };


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N < YYNSTATE                  Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   YYNSTATE <= N < YYNSTATE+YYNRULE   Reduce by rule N-YYNSTATE.
**
**   N == YYNSTATE+YYNRULE              A syntax error has occurred.
**
**   N == YYNSTATE+YYNRULE+1            The parser accepts its input.
**
**   N == YYNSTATE+YYNRULE+2            No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as
**
**      yy_action[ yy_shift_ofst[S] + X ]
**
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.  
**
** The formula above is for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
*/
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   304,  930,  120,  609,    1,  178,  214,  436,   62,   62,
 /*    10 */    62,   62,  216,   64,   64,   64,   64,   65,   65,   66,
 /*    20 */    66,   66,   67,  216,  406,  403,  443,  449,   69,   64,
 /*    30 */    64,   64,   64,   65,   65,   66,   66,   66,   67,  216,
 /*    40 */   469,  467,  336,  174,   61,   60,  309,  453,  454,  450,
 /*    50 */   450,   63,   63,   62,   62,   62,   62,  200,   64,   64,
 /*    60 */    64,   64,   65,   65,   66,   66,   66,   67,  216,  304,
 /*    70 */   510,  312,  436,  509,  438,   83,   64,   64,   64,   64,
 /*    80 */    65,   65,   66,   66,   66,   67,  216,   65,   65,   66,
 /*    90 */    66,   66,   67,  216,  511,  443,  449,  325,  408,   59,
 /*   100 */   465,  218,   57,  213,  411,  496,  428,  440,  440,  440,
 /*   110 */   206,   67,  216,   61,   60,  309,  453,  454,  450,  450,
 /*   120 */    63,   63,   62,   62,   62,   62,  552,   64,   64,   64,
 /*   130 */    64,   65,   65,   66,   66,   66,   67,  216,  304,  228,
 /*   140 */   186,  469,  544,  312,  433,  170,  114,  256,  357,  261,
 /*   150 */   358,  181,  425,   20,  426,  542,  153,   85,  265,  465,
 /*   160 */   218,  150,  151,  539,  443,  449,   95,  311,  394,  412,
 /*   170 */   413,  510,  276,  427,  436,  438,  152,  553,  545,  589,
 /*   180 */   590,  539,   61,   60,  309,  453,  454,  450,  450,   63,
 /*   190 */    63,   62,   62,   62,   62,  402,   64,   64,   64,   64,
 /*   200 */    65,   65,   66,   66,   66,   67,  216,  304,  440,  440,
 /*   210 */   440,  228,  109,  411,  399,  523,  593,  330,  114,  256,
 /*   220 */   357,  261,  358,  181,  187,  330,  485,  359,  362,  363,
 /*   230 */   265,  593,  241,  443,  449,  592,  591,  248,  364,  436,
 /*   240 */   432,   35,  492,   66,   66,   66,   67,  216,  432,   42,
 /*   250 */   592,   61,   60,  309,  453,  454,  450,  450,   63,   63,
 /*   260 */    62,   62,   62,   62,  401,   64,   64,   64,   64,   65,
 /*   270 */    65,   66,   66,   66,   67,  216,  304,  570,  412,  413,
 /*   280 */   187,  501,  344,  359,  362,  363,  215,  354,  346,  221,
 /*   290 */   330,  341,  330,   56,  364,  569,  588,  217,   68,  156,
 /*   300 */    70,  155,  443,  449,   68,  187,   70,  155,  359,  362,
 /*   310 */   363,  397,  217,  432,   35,  432,   36,  148,  569,  364,
 /*   320 */    61,   60,  309,  453,  454,  450,  450,   63,   63,   62,
 /*   330 */    62,   62,   62,  433,   64,   64,   64,   64,   65,   65,
 /*   340 */    66,   66,   66,   67,  216,  387,  282,  281,  330,  304,
 /*   350 */   474,   68,  480,   70,  155,  344,  214,  154,  299,  330,
 /*   360 */   343,  467,  543,  174,  384,  475,  257,  247,  387,  282,
 /*   370 */   281,  432,   28,  411,  160,  443,  449,  258,  476,  214,
 /*   380 */   516,  496,  432,   42,  198,  492,   68,  162,   70,  155,
 /*   390 */   517,  433,   78,   61,   60,  309,  453,  454,  450,  450,
 /*   400 */    63,   63,   62,   62,   62,   62,  595,   64,   64,   64,
 /*   410 */    64,   65,   65,   66,   66,   66,   67,  216,  433,  367,
 /*   420 */   349,  433,  304,  220,  222,  544,  505,  330,  465,  330,
 /*   430 */   230,  330,  240,  163,  161,  554,   20,  431,  412,  413,
 /*   440 */     2,  430,  385,  375,  411,  198,  182,  249,  443,  449,
 /*   450 */   432,   35,  432,   50,  432,   50,  310,  460,  461,   17,
 /*   460 */   207,  335,  460,  461,  388,   81,   61,   60,  309,  453,
 /*   470 */   454,  450,  450,   63,   63,   62,   62,   62,   62,  433,
 /*   480 */    64,   64,   64,   64,   65,   65,   66,   66,   66,   67,
 /*   490 */   216,  304,  348,  504,  433,  508,  531,  486,  320,  353,
 /*   500 */   321,  306,  457,  385,   23,  331,  265,  470,  411,  412,
 /*   510 */   413,  444,  445,  551,  526,  307,  532,  443,  449,  217,
 /*   520 */   550,  496,  432,    3,  217,  381,  607,  921,  333,  921,
 /*   530 */   456,  456,  447,  448,  276,   61,   60,  309,  453,  454,
 /*   540 */   450,  450,   63,   63,   62,   62,   62,   62,  410,   64,
 /*   550 */    64,   64,   64,   65,   65,   66,   66,   66,   67,  216,
 /*   560 */   304,  446,  607,  920,  525,  920,  604,  264,  314,  474,
 /*   570 */   411,  123,  411,  412,  413,  124,  277,  487,  234,  333,
 /*   580 */   411,  456,  456,  319,  475,  411,  443,  449,  333,  377,
 /*   590 */   456,  456,  286,  333,  380,  456,  456,  476,  178,  340,
 /*   600 */   436,  420,  604,  315,   61,   60,  309,  453,  454,  450,
 /*   610 */   450,   63,   63,   62,   62,   62,   62,  330,   64,   64,
 /*   620 */    64,   64,   65,   65,   66,   66,   66,   67,  216,  304,
 /*   630 */   289,    5,  287,  268,  466,  412,  413,  412,  413,  396,
 /*   640 */   432,   29,  503,  330,  159,  412,  413,  610,  406,  403,
 /*   650 */   412,  413,  414,  415,  416,  443,  449,  333,  214,  456,
 /*   660 */   456,  488,  276,  489,   21,  436,  432,   24,  436,  487,
 /*   670 */   514,  515,  395,   61,   60,  309,  453,  454,  450,  450,
 /*   680 */    63,   63,   62,   62,   62,   62,  330,   64,   64,   64,
 /*   690 */    64,   65,   65,   66,   66,   66,   67,  216,  304,  560,
 /*   700 */   374,  560,  352,   94,  578,  330,  567,  515,  330,  432,
 /*   710 */    33,  330,  288,  330,  562,  330,  544,  330,  561,  183,
 /*   720 */   184,  185,  603,  303,  443,  449,  600,   20,  432,   54,
 /*   730 */   376,  432,   53,  436,  432,   99,  432,   97,  432,  102,
 /*   740 */   432,  103,   61,   60,  309,  453,  454,  450,  450,   63,
 /*   750 */    63,   62,   62,   62,   62,  330,   64,   64,   64,   64,
 /*   760 */    65,   65,   66,   66,   66,   67,  216,  304,  330,  405,
 /*   770 */     1,  202,  330,  512,  330,  214,  330,  171,  432,  108,
 /*   780 */   330,  421,  429,  330,  487,  342,  330,  384,   19,  386,
 /*   790 */   145,  432,  110,  443,  449,  432,   16,  432,  100,  432,
 /*   800 */    34,  351,  270,  432,   98,  433,  432,   25,  276,  432,
 /*   810 */    55,   61,   60,  309,  453,  454,  450,  450,   63,   63,
 /*   820 */    62,   62,   62,   62,  330,   64,   64,   64,   64,   65,
 /*   830 */    65,   66,   66,   66,   67,  216,  304,  330,  323,  119,
 /*   840 */   274,  330,  272,  330,  355,  330,  422,  432,  111,  330,
 /*   850 */   580,  159,  115,  233,  330,  177,  161,  439,  463,  463,
 /*   860 */   432,  112,  443,  449,  432,  113,  432,   26,  432,   37,
 /*   870 */   649,  431,  432,   38,  492,  430,  487,  432,   27,  264,
 /*   880 */    61,   71,  309,  453,  454,  450,  450,   63,   63,   62,
 /*   890 */    62,   62,   62,  330,   64,   64,   64,   64,   65,   65,
 /*   900 */    66,   66,   66,   67,  216,  304,  330,  264,  264,  528,
 /*   910 */   330,  157,  330,  252,  330,  229,  432,   39,  330,  482,
 /*   920 */   332,  478,   77,  330,   79,  330,  483,  520,  521,  432,
 /*   930 */    40,  443,  449,  432,   41,  432,   43,  432,   44,  492,
 /*   940 */   491,  432,   45,  316,  317,  433,  432,   30,  432,   31,
 /*   950 */    60,  309,  453,  454,  450,  450,   63,   63,   62,   62,
 /*   960 */    62,   62,  330,   64,   64,   64,   64,   65,   65,   66,
 /*   970 */    66,   66,   67,  216,  304,  330,  264,  564,  254,  330,
 /*   980 */   458,  330,   22,  330,  495,  432,   46,  330,  494,  535,
 /*   990 */   179,  186,  330,  267,  330,  186,  451,  497,  432,   47,
 /*  1000 */   443,  449,  432,   48,  432,   49,  432,   32,  182,  262,
 /*  1010 */   432,   10,  318,  276,  389,  432,   51,  432,   52,  276,
 /*  1020 */   309,  453,  454,  450,  450,   63,   63,   62,   62,   62,
 /*  1030 */    62,  276,   64,   64,   64,   64,   65,   65,   66,   66,
 /*  1040 */    66,   67,  216,  165,  276,  276,  189,  192,  235,  236,
 /*  1050 */   237,  168,  239,  566,  105,  581,   18,  530,  529,   73,
 /*  1060 */   337,  582,    4,  306,  605,  527,  308,  211,  366,  294,
 /*  1070 */   186,  263,  533,  231,  334,  565,  295,  186,  534,  546,
 /*  1080 */   433,  433,  573,  574,  179,   92,  232,  292,  209,  269,
 /*  1090 */   569,  339,  271,  853,  208,  273,  275,  210,  585,  195,
 /*  1100 */    92,  469,  371,  606,  602,    8,  302,  423,  280,  379,
 /*  1110 */   382,  383,  147,  242,  283,  437,  462,  284,  285,  577,
 /*  1120 */   338,   76,   75,  587,  293,  296,  297,  599,  481,  464,
 /*  1130 */    74,  328,  329,  250,  526,  438,  572,  166,  290,  393,
 /*  1140 */   392,  291,  281,  409,  537,  584,  305,  484,  259,  540,
 /*  1150 */   417,  214,  418,  214,  536,  326,  538,  419,  361,  167,
 /*  1160 */    73,  337,  169,    4,    7,  327,  347,  308,  440,  440,
 /*  1170 */   440,  441,  442,   11,   85,  334,  398,   84,  434,  345,
 /*  1180 */   243,   58,  244,   73,  337,   80,    4,  245,  435,  246,
 /*  1190 */   308,  176,  339,  479,   86,  121,  356,  350,  334,  493,
 /*  1200 */   251,  253,  469,  499,  255,  513,  500,  518,  313,  519,
 /*  1210 */   260,  523,  125,  522,  226,  339,  219,  524,  368,  190,
 /*  1220 */   191,  300,   76,   75,  502,  469,  225,  227,  547,  541,
 /*  1230 */   548,   74,  328,  329,  301,  555,  438,  549,  370,  193,
 /*  1240 */   372,  194,  557,   89,  196,   76,   75,  278,  378,  117,
 /*  1250 */   558,  568,  133,  390,   74,  328,  329,  199,  391,  438,
 /*  1260 */   322,  134,  135,  136,  575,  143,  583,  596,  139,  440,
 /*  1270 */   440,  440,  441,  442,   11,  597,  598,  601,  137,  142,
 /*  1280 */   101,  224,  104,  407,  238,  424,  650,  651,   93,  172,
 /*  1290 */    96,  173,  440,  440,  440,  441,  442,   11,  452,  455,
 /*  1300 */    72,  471,  459,  468,  472,  144,  158,    6,  473,  490,
 /*  1310 */   107,  175,  477,   82,   13,  122,   12,  180,  506,  118,
 /*  1320 */   498,  164,  507,  324,  223,   87,  126,  116,  266,  127,
 /*  1330 */    88,  128,  188,  258,  360,  369,  146,  556,  129,  373,
 /*  1340 */   179,  365,  279,  197,  131,  130,  563,    9,  571,  132,
 /*  1350 */   559,  201,   14,  576,  203,  204,  205,  579,  140,  138,
 /*  1360 */   141,   15,  586,  594,  212,  106,  400,  298,  149,  404,
 /*  1370 */   931,  608,   90,   91,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */    19,  142,  143,  144,  145,   24,  113,   26,   72,   73,
 /*    10 */    74,   75,   87,   77,   78,   79,   80,   81,   82,   83,
 /*    20 */    84,   85,   86,   87,    1,    2,   45,   46,   76,   77,
 /*    30 */    78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
 /*    40 */    61,  165,  166,  167,   63,   64,   65,   66,   67,   68,
 /*    50 */    69,   70,   71,   72,   73,   74,   75,   25,   77,   78,
 /*    60 */    79,   80,   81,   82,   83,   84,   85,   86,   87,   19,
 /*    70 */    91,   19,   91,  173,   95,   25,   77,   78,   79,   80,
 /*    80 */    81,   82,   83,   84,   85,   86,   87,   81,   82,   83,
 /*    90 */    84,   85,   86,   87,  173,   45,   46,  146,  147,   49,
 /*   100 */    81,   82,   22,  152,   26,  150,   26,  128,  129,  130,
 /*   110 */   159,   86,   87,   63,   64,   65,   66,   67,   68,   69,
 /*   120 */    70,   71,   72,   73,   74,   75,  185,   77,   78,   79,
 /*   130 */    80,   81,   82,   83,   84,   85,   86,   87,   19,   87,
 /*   140 */    25,   61,  150,   19,  193,   93,   94,   95,   96,   97,
 /*   150 */    98,   99,  160,  161,  171,  172,   25,  125,  106,   81,
 /*   160 */    82,   81,   82,  180,   45,   46,   47,  212,  217,   91,
 /*   170 */    92,   91,  150,  172,   26,   95,  184,  185,  185,  101,
 /*   180 */   102,  180,   63,   64,   65,   66,   67,   68,   69,   70,
 /*   190 */    71,   72,   73,   74,   75,  244,   77,   78,   79,   80,
 /*   200 */    81,   82,   83,   84,   85,   86,   87,   19,  128,  129,
 /*   210 */   130,   87,   24,   26,  192,  100,  150,  150,   94,   95,
 /*   220 */    96,   97,   98,   99,   93,  150,   25,   96,   97,   98,
 /*   230 */   106,  150,  194,   45,   46,  169,  170,  150,  107,   91,
 /*   240 */   173,  174,  165,   83,   84,   85,   86,   87,  173,  174,
 /*   250 */   169,   63,   64,   65,   66,   67,   68,   69,   70,   71,
 /*   260 */    72,   73,   74,   75,  242,   77,   78,   79,   80,   81,
 /*   270 */    82,   83,   84,   85,   86,   87,   19,   11,   91,   92,
 /*   280 */    93,  204,  215,   96,   97,   98,  196,  220,  213,  214,
 /*   290 */   150,  190,  150,  203,  107,   52,  230,  231,  221,  159,
 /*   300 */   223,  224,   45,   46,  221,   93,  223,  224,   96,   97,
 /*   310 */    98,  230,  231,  173,  174,  173,  174,  116,   52,  107,
 /*   320 */    63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
 /*   330 */    73,   74,   75,  193,   77,   78,   79,   80,   81,   82,
 /*   340 */    83,   84,   85,   86,   87,  102,  103,  104,  150,   19,
 /*   350 */    12,  221,  222,  223,  224,  215,  113,  159,  162,  150,
 /*   360 */   220,  165,  166,  167,  150,   27,   95,  225,  102,  103,
 /*   370 */   104,  173,  174,   26,  150,   45,   46,  106,   40,  113,
 /*   380 */    42,  150,  173,  174,  159,  165,  221,  159,  223,  224,
 /*   390 */    52,  193,  135,   63,   64,   65,   66,   67,   68,   69,
 /*   400 */    70,   71,   72,   73,   74,   75,  241,   77,   78,   79,
 /*   410 */    80,   81,   82,   83,   84,   85,   86,   87,  193,   19,
 /*   420 */   150,  193,   19,  214,  204,  150,   23,  150,   81,  150,
 /*   430 */   216,  150,  157,  205,  206,  160,  161,  110,   91,   92,
 /*   440 */    22,  114,  217,  212,   26,  159,   46,  150,   45,   46,
 /*   450 */   173,  174,  173,  174,  173,  174,  168,  169,  170,  234,
 /*   460 */   159,  168,  169,  170,  239,  135,   63,   64,   65,   66,
 /*   470 */    67,   68,   69,   70,   71,   72,   73,   74,   75,  193,
 /*   480 */    77,   78,   79,   80,   81,   82,   83,   84,   85,   86,
 /*   490 */    87,   19,  215,   23,  193,   23,   33,  207,  219,  150,
 /*   500 */   219,  101,   23,  217,   22,  150,  106,   23,   26,   91,
 /*   510 */    92,   45,   46,  180,  181,  154,   53,   45,   46,  231,
 /*   520 */   187,  150,  173,  174,  231,  239,   22,   23,  109,   25,
 /*   530 */   111,  112,   66,   67,  150,   63,   64,   65,   66,   67,
 /*   540 */    68,   69,   70,   71,   72,   73,   74,   75,  150,   77,
 /*   550 */    78,   79,   80,   81,   82,   83,   84,   85,   86,   87,
 /*   560 */    19,   95,   22,   23,   23,   25,   62,  150,  105,   12,
 /*   570 */    26,   23,   26,   91,   92,   23,  192,   25,  148,  109,
 /*   580 */    26,  111,  112,  212,   27,   26,   45,   46,  109,  228,
 /*   590 */   111,  112,   17,  109,  233,  111,  112,   40,   24,   42,
 /*   600 */    26,  150,   62,  186,   63,   64,   65,   66,   67,   68,
 /*   610 */    69,   70,   71,   72,   73,   74,   75,  150,   77,   78,
 /*   620 */    79,   80,   81,   82,   83,   84,   85,   86,   87,   19,
 /*   630 */    55,  195,   57,   23,  165,   91,   92,   91,   92,   94,
 /*   640 */   173,  174,   83,  150,   92,   91,   92,    0,    1,    2,
 /*   650 */    91,   92,    7,    8,    9,   45,   46,  109,  113,  111,
 /*   660 */   112,  117,  150,  117,   22,   91,  173,  174,   26,  117,
 /*   670 */   189,  190,  127,   63,   64,   65,   66,   67,   68,   69,
 /*   680 */    70,   71,   72,   73,   74,   75,  150,   77,   78,   79,
 /*   690 */    80,   81,   82,   83,   84,   85,   86,   87,   19,  102,
 /*   700 */   103,  104,   19,   24,  192,  150,  189,  190,  150,  173,
 /*   710 */   174,  150,  137,  150,   28,  150,  150,  150,   32,  102,
 /*   720 */   103,  104,  247,  248,   45,   46,  160,  161,  173,  174,
 /*   730 */    44,  173,  174,   91,  173,  174,  173,  174,  173,  174,
 /*   740 */   173,  174,   63,   64,   65,   66,   67,   68,   69,   70,
 /*   750 */    71,   72,   73,   74,   75,  150,   77,   78,   79,   80,
 /*   760 */    81,   82,   83,   84,   85,   86,   87,   19,  150,  144,
 /*   770 */   145,  159,  150,  164,  150,  113,  150,   22,  173,  174,
 /*   780 */   150,  150,  173,  150,   25,  150,  150,  150,   22,  127,
 /*   790 */    24,  173,  174,   45,   46,  173,  174,  173,  174,  173,
 /*   800 */   174,  118,   17,  173,  174,  193,  173,  174,  150,  173,
 /*   810 */   174,   63,   64,   65,   66,   67,   68,   69,   70,   71,
 /*   820 */    72,   73,   74,   75,  150,   77,   78,   79,   80,   81,
 /*   830 */    82,   83,   84,   85,   86,   87,   19,  150,  245,  246,
 /*   840 */    55,  150,   57,  150,   83,  150,  150,  173,  174,  150,
 /*   850 */   192,   92,  150,  216,  150,  205,  206,  150,  128,  129,
 /*   860 */   173,  174,   45,   46,  173,  174,  173,  174,  173,  174,
 /*   870 */   115,  110,  173,  174,  165,  114,  117,  173,  174,  150,
 /*   880 */    63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
 /*   890 */    73,   74,   75,  150,   77,   78,   79,   80,   81,   82,
 /*   900 */    83,   84,   85,   86,   87,   19,  150,  150,  150,  182,
 /*   910 */   150,  159,  150,  204,  150,  186,  173,  174,  150,   30,
 /*   920 */    19,  150,  134,  150,  136,  150,   37,    7,    8,  173,
 /*   930 */   174,   45,   46,  173,  174,  173,  174,  173,  174,  165,
 /*   940 */   150,  173,  174,  186,  186,  193,  173,  174,  173,  174,
 /*   950 */    64,   65,   66,   67,   68,   69,   70,   71,   72,   73,
 /*   960 */    74,   75,  150,   77,   78,   79,   80,   81,   82,   83,
 /*   970 */    84,   85,   86,   87,   19,  150,  150,   21,  204,  150,
 /*   980 */    23,  150,   25,  150,  150,  173,  174,  150,   23,   23,
 /*   990 */    25,   25,  150,   23,  150,   25,   95,  150,  173,  174,
 /*  1000 */    45,   46,  173,  174,  173,  174,  173,  174,   46,  150,
 /*  1010 */   173,  174,  186,  150,   58,  173,  174,  173,  174,  150,
 /*  1020 */    65,   66,   67,   68,   69,   70,   71,   72,   73,   74,
 /*  1030 */    75,  150,   77,   78,   79,   80,   81,   82,   83,   84,
 /*  1040 */    85,   86,   87,    5,  150,  150,  159,  159,   10,   11,
 /*  1050 */    12,   13,   14,   97,   16,  192,   22,   94,   95,   19,
 /*  1060 */    20,  192,   22,  101,   23,  150,   26,   29,   23,   31,
 /*  1070 */    25,  150,  182,  192,   34,   23,   38,   25,  182,  150,
 /*  1080 */   193,  193,   23,   23,   25,   25,  192,  192,   50,  150,
 /*  1090 */    52,   51,  150,  137,   56,  150,  150,   59,   23,  235,
 /*  1100 */    25,   61,  236,   62,   23,   71,   25,  153,  150,  150,
 /*  1110 */   150,  150,  195,  197,  150,  165,  232,  150,  150,  150,
 /*  1120 */   227,   81,   82,  150,  150,  150,  150,  150,  176,  232,
 /*  1130 */    90,   91,   92,  208,  181,   95,  198,    6,  208,  208,
 /*  1140 */   102,  103,  104,  149,  165,  198,  108,  176,  176,  165,
 /*  1150 */   149,  113,  149,  113,  176,  149,  176,   13,  177,  151,
 /*  1160 */    19,   20,  151,   22,   25,  158,  122,   26,  128,  129,
 /*  1170 */   130,  131,  132,  133,  125,   34,  138,  123,  193,  121,
 /*  1180 */   198,  124,  199,   19,   20,  134,   22,  200,  202,  201,
 /*  1190 */    26,  115,   51,  156,  101,  156,  101,  120,   34,  210,
 /*  1200 */   209,  209,   61,  210,  209,  175,  210,  175,   43,  183,
 /*  1210 */   175,  100,   22,  177,   87,   51,  226,  175,   18,  155,
 /*  1220 */   155,  178,   81,   82,   83,   61,  229,  229,  175,  183,
 /*  1230 */   175,   90,   91,   92,  178,  156,   95,  175,  156,  155,
 /*  1240 */    41,  156,  156,  134,  155,   81,   82,  237,  156,   63,
 /*  1250 */   238,  188,   22,  156,   90,   91,   92,  188,   18,   95,
 /*  1260 */   156,  191,  191,  191,  198,  218,  198,   36,  188,  128,
 /*  1270 */   129,  130,  131,  132,  133,  156,  156,  140,  191,  218,
 /*  1280 */   163,  179,  179,    1,   15,   23,  115,  115,  240,  115,
 /*  1290 */   240,  115,  128,  129,  130,  131,  132,  133,   95,  110,
 /*  1300 */    22,   11,   23,   23,   23,   22,   22,  119,   23,  117,
 /*  1310 */   243,   25,   23,   25,  119,   22,   25,  119,   23,  246,
 /*  1320 */   118,  115,   23,  249,   47,   22,   22,   35,   23,   22,
 /*  1330 */    22,   22,   99,  106,   47,   19,   24,   20,  101,   39,
 /*  1340 */    25,   47,  137,  101,   22,   48,   48,    5,    1,  105,
 /*  1350 */    54,  126,   22,    1,  116,   17,  120,   20,  105,  116,
 /*  1360 */   126,   22,  127,   23,   15,   17,   60,  139,   22,    3,
 /*  1370 */   250,    4,   71,   71,
};
#define YY_SHIFT_USE_DFLT (-108)
#define YY_SHIFT_MAX 404
static const short yy_shift_ofst[] = {
 /*     0 */    23, 1038, 1040,  -19, 1040, 1164, 1164,  187,   78,  243,
 /*    10 */   119, 1164, 1164, 1164, 1164, 1164,  -48,  266,  347,  554,
 /*    20 */   148,   19,   19, -107,   50,  188,  257,  330,  403,  472,
 /*    30 */   541,  610,  679,  748,  817,  748,  748,  748,  748,  748,
 /*    40 */   748,  748,  748,  748,  748,  748,  748,  748,  748,  748,
 /*    50 */   748,  748,  748,  886,  955,  955, 1141, 1164, 1164, 1164,
 /*    60 */  1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
 /*    70 */  1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
 /*    80 */  1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164,
 /*    90 */  1164, 1164, 1164, 1164, 1164, 1164, 1164,  -64,  -64,   -1,
 /*   100 */    -1,   52,    6,  160,  400,  956,  554,  554,   25,  148,
 /*   110 */   -75, -108, -108, -108,   80,  124,  338,  338,  504,  540,
 /*   120 */   647,  574,  554,  574,  574,  554,  554,  554,  554,  554,
 /*   130 */   554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
 /*   140 */   554,  554,  545,  662, -107, -107, -107, -108, -108, -108,
 /*   150 */   -21,  -21,  131,  212,  470,  418,  479,  484,  557,  544,
 /*   160 */   546,  482,  548,  552,  559,  645,  554,  554,  554,  554,
 /*   170 */   554,  761,  554,  554,  642,  554,  554,  759,  554,  554,
 /*   180 */   554,  554,  554,  463,  463,  463,  554,  554,  554,  419,
 /*   190 */   554,  554,  419,  554,  686,  597,  554,  554,  419,  554,
 /*   200 */   554,  554,  419,  554,  554,  554,  419,  419,  554,  554,
 /*   210 */   554,  554,  554,  766,  327,  201,  148,  730,  730,  788,
 /*   220 */   889,  889,  683,  889,  962,  889,  148,  889,  148,  115,
 /*   230 */    32,  683,  683,   32, 1131, 1131, 1131, 1131, 1144, 1144,
 /*   240 */  1139, -107, 1049, 1044, 1054, 1058, 1057, 1051, 1076, 1076,
 /*   250 */  1093, 1077, 1093, 1077, 1093, 1077, 1095, 1095, 1165, 1095,
 /*   260 */  1111, 1095, 1190, 1127, 1127, 1165, 1095, 1095, 1095, 1190,
 /*   270 */  1200, 1076, 1200, 1076, 1200, 1076, 1076, 1199, 1109, 1200,
 /*   280 */  1076, 1186, 1186, 1230, 1049, 1076, 1240, 1240, 1240, 1240,
 /*   290 */  1049, 1186, 1230, 1076, 1231, 1231, 1076, 1076, 1137, -108,
 /*   300 */  -108, -108, -108, -108,  466,  575,  617,  785,  755,  901,
 /*   310 */   957,  965,  271,  920,  963,  966,  970, 1045, 1052, 1059,
 /*   320 */  1060, 1075, 1034, 1081, 1041, 1282, 1269, 1262, 1171, 1172,
 /*   330 */  1174, 1176, 1203, 1189, 1278, 1279, 1280, 1283, 1290, 1284,
 /*   340 */  1281, 1286, 1285, 1289, 1288, 1188, 1291, 1195, 1288, 1192,
 /*   350 */  1293, 1198, 1202, 1206, 1295, 1299, 1292, 1277, 1303, 1287,
 /*   360 */  1304, 1305, 1307, 1308, 1294, 1309, 1233, 1227, 1316, 1317,
 /*   370 */  1312, 1237, 1300, 1296, 1297, 1315, 1298, 1205, 1242, 1322,
 /*   380 */  1342, 1347, 1244, 1301, 1302, 1225, 1330, 1238, 1352, 1338,
 /*   390 */  1236, 1337, 1243, 1253, 1234, 1339, 1235, 1340, 1348, 1306,
 /*   400 */  1349, 1228, 1346, 1366, 1367,
};
#define YY_REDUCE_USE_DFLT (-142)
#define YY_REDUCE_MAX 303
static const short yy_reduce_ofst[] = {
 /*     0 */  -141,  -49,  140,   77,  198,   67,   75,   -8,   66,  225,
 /*    10 */   165,  142,  209,  277,  279,  281,  130,  286,   81,  275,
 /*    20 */   196,  288,  293,  228,   83,   83,   83,   83,   83,   83,
 /*    30 */    83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
 /*    40 */    83,   83,   83,   83,   83,   83,   83,   83,   83,   83,
 /*    50 */    83,   83,   83,   83,   83,   83,  349,  467,  493,  536,
 /*    60 */   555,  558,  561,  563,  565,  567,  605,  618,  622,  624,
 /*    70 */   626,  630,  633,  636,  674,  687,  691,  693,  695,  699,
 /*    80 */   704,  743,  756,  760,  762,  764,  768,  773,  775,  812,
 /*    90 */   825,  829,  831,  833,  837,  842,  844,   83,   83,   83,
 /*   100 */    83,  -17,   83,   83,  333,  361,   22,  566,   83, -124,
 /*   110 */    83,   83,   83,   83,  609,    1,  481,  517,  475,  475,
 /*   120 */   625,  220,  -45,  709,  774,  417,  729,  757,  758,  384,
 /*   130 */   231,  826,  214,  371,  512,  658,  863,  869,  881,  894,
 /*   140 */   637,  895,  301,  612,  752,  887,  888,   90,  650,  593,
 /*   150 */  -100,  -79,  -59,   -7,   38,   87,   38,   38,  101,  224,
 /*   160 */   270,  297,   38,  290,  355,  430,  398,  451,  631,  696,
 /*   170 */   702,  436,  355,  707,  469,  635,  771,  290,  790,  834,
 /*   180 */   847,  859,  915,  727,  890,  896,  921,  929,  939,   38,
 /*   190 */   942,  945,   38,  946,  864,  866,  958,  959,   38,  960,
 /*   200 */   961,  964,   38,  967,  968,  969,   38,   38,  973,  974,
 /*   210 */   975,  976,  977,  954,  917,  916,  950,  884,  897,  893,
 /*   220 */   952,  971,  925,  972,  953,  978,  979,  980,  984,  981,
 /*   230 */   938,  930,  931,  947,  994, 1001, 1003, 1006, 1008, 1011,
 /*   240 */  1007,  985,  982,  983,  987,  988,  986,  990, 1037, 1039,
 /*   250 */   991,  989,  992,  993,  995,  996, 1030, 1032, 1026, 1035,
 /*   260 */  1036, 1042, 1043,  997,  998, 1046, 1053, 1055, 1062, 1056,
 /*   270 */  1064, 1079, 1065, 1082, 1084, 1085, 1086, 1010, 1012, 1089,
 /*   280 */  1092, 1063, 1069, 1047, 1066, 1097, 1070, 1071, 1072, 1087,
 /*   290 */  1068, 1080, 1061, 1104, 1048, 1050, 1119, 1120, 1067, 1117,
 /*   300 */  1102, 1103, 1073, 1074,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   615,  929,  848,  736,  929,  848,  929,  929,  875,  929,
 /*    10 */   904,  846,  929,  929,  929,  929,  820,  929,  875,  929,
 /*    20 */   652,  875,  875,  740,  771,  929,  929,  929,  929,  929,
 /*    30 */   929,  929,  929,  772,  929,  850,  845,  841,  843,  842,
 /*    40 */   849,  773,  762,  769,  776,  751,  888,  778,  779,  785,
 /*    50 */   786,  905,  903,  808,  807,  826,  929,  929,  929,  929,
 /*    60 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    70 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    80 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*    90 */   929,  929,  929,  929,  929,  929,  929,  810,  832,  809,
 /*   100 */   819,  645,  811,  812,  705,  640,  929,  929,  813,  929,
 /*   110 */   814,  827,  828,  829,  929,  929,  929,  929,  929,  929,
 /*   120 */   615,  736,  929,  736,  736,  929,  929,  929,  929,  929,
 /*   130 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   140 */   929,  929,  929,  929,  929,  929,  929,  730,  740,  922,
 /*   150 */   929,  929,  696,  929,  929,  929,  929,  929,  929,  929,
 /*   160 */   929,  929,  929,  929,  929,  623,  621,  929,  929,  929,
 /*   170 */   929,  728,  929,  929,  654,  929,  929,  738,  929,  929,
 /*   180 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  642,
 /*   190 */   929,  929,  717,  929,  881,  929,  929,  929,  895,  929,
 /*   200 */   929,  929,  893,  929,  929,  929,  719,  781,  861,  929,
 /*   210 */   908,  910,  929,  929,  728,  737,  929,  929,  929,  844,
 /*   220 */   765,  765,  753,  765,  675,  765,  929,  765,  929,  678,
 /*   230 */   775,  753,  753,  775,  620,  620,  620,  620,  631,  631,
 /*   240 */   695,  929,  775,  766,  768,  758,  770,  929,  744,  744,
 /*   250 */   752,  757,  752,  757,  752,  757,  707,  707,  692,  707,
 /*   260 */   678,  707,  854,  858,  858,  692,  707,  707,  707,  854,
 /*   270 */   637,  744,  637,  744,  637,  744,  744,  885,  887,  637,
 /*   280 */   744,  709,  709,  787,  775,  744,  716,  716,  716,  716,
 /*   290 */   775,  709,  787,  744,  907,  907,  744,  744,  915,  662,
 /*   300 */   680,  680,  922,  927,  929,  929,  929,  929,  794,  929,
 /*   310 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   320 */   929,  929,  868,  929,  929,  929,  629,  929,  799,  795,
 /*   330 */   929,  796,  929,  722,  929,  929,  929,  929,  929,  929,
 /*   340 */   929,  929,  929,  929,  847,  929,  759,  929,  767,  929,
 /*   350 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   360 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   370 */   929,  929,  929,  929,  883,  884,  929,  929,  929,  929,
 /*   380 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  929,
 /*   390 */   929,  929,  929,  929,  929,  929,  929,  929,  929,  914,
 /*   400 */   929,  929,  917,  616,  929,  611,  613,  614,  618,  619,
 /*   410 */   622,  649,  650,  651,  624,  625,  626,  627,  628,  630,
 /*   420 */   634,  632,  633,  635,  641,  643,  661,  663,  647,  665,
 /*   430 */   726,  727,  791,  720,  721,  725,  648,  802,  793,  797,
 /*   440 */   798,  800,  801,  815,  816,  818,  824,  831,  834,  817,
 /*   450 */   822,  823,  825,  830,  833,  723,  724,  837,  655,  656,
 /*   460 */   659,  660,  871,  873,  872,  874,  658,  657,  803,  806,
 /*   470 */   839,  840,  896,  897,  898,  899,  900,  835,  745,  838,
 /*   480 */   821,  760,  763,  764,  761,  729,  739,  747,  748,  749,
 /*   490 */   750,  734,  735,  741,  756,  789,  790,  754,  755,  742,
 /*   500 */   743,  731,  732,  733,  836,  792,  804,  805,  666,  667,
 /*   510 */   799,  668,  669,  670,  708,  711,  712,  713,  671,  690,
 /*   520 */   693,  694,  672,  679,  673,  674,  681,  682,  683,  686,
 /*   530 */   687,  688,  689,  684,  685,  855,  856,  859,  857,  676,
 /*   540 */   677,  691,  664,  653,  646,  697,  700,  701,  702,  703,
 /*   550 */   704,  706,  698,  699,  644,  636,  638,  746,  877,  886,
 /*   560 */   882,  878,  879,  880,  639,  851,  852,  710,  783,  784,
 /*   570 */   876,  889,  891,  788,  892,  894,  890,  919,  714,  715,
 /*   580 */   718,  860,  901,  774,  777,  780,  782,  862,  863,  864,
 /*   590 */   865,  866,  869,  870,  867,  902,  906,  909,  911,  912,
 /*   600 */   913,  916,  918,  923,  924,  925,  928,  926,  617,  612,
};
#define YY_SZ_ACTTAB (int)(sizeof(yy_action)/sizeof(yy_action[0]))

/* The next table maps tokens into fallback tokens.  If a construct
** like the following:
** 
**      %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
    0,  /*          $ => nothing */
    0,  /*       SEMI => nothing */
   26,  /*    EXPLAIN => ID */
   26,  /*      QUERY => ID */
   26,  /*       PLAN => ID */
   26,  /*      BEGIN => ID */
    0,  /* TRANSACTION => nothing */
   26,  /*   DEFERRED => ID */
   26,  /*  IMMEDIATE => ID */
   26,  /*  EXCLUSIVE => ID */
    0,  /*     COMMIT => nothing */
   26,  /*        END => ID */
    0,  /*   ROLLBACK => nothing */
    0,  /*  SAVEPOINT => nothing */
    0,  /*    RELEASE => nothing */
    0,  /*         TO => nothing */
    0,  /*     CREATE => nothing */
    0,  /*      TABLE => nothing */
   26,  /*         IF => ID */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
   26,  /*       TEMP => ID */
    0,  /*         LP => nothing */
    0,  /*         RP => nothing */
    0,  /*         AS => nothing */
    0,  /*      COMMA => nothing */
    0,  /*         ID => nothing */
   26,  /*      ABORT => ID */
   26,  /*      AFTER => ID */
   26,  /*    ANALYZE => ID */
   26,  /*        ASC => ID */
   26,  /*     ATTACH => ID */
   26,  /*     BEFORE => ID */
   26,  /*    CASCADE => ID */
   26,  /*       CAST => ID */
   26,  /*   CONFLICT => ID */
   26,  /*   DATABASE => ID */
   26,  /*       DESC => ID */
   26,  /*     DETACH => ID */
   26,  /*       EACH => ID */
   26,  /*       FAIL => ID */
   26,  /*        FOR => ID */
   26,  /*     IGNORE => ID */
   26,  /*  INITIALLY => ID */
   26,  /*    INSTEAD => ID */
   26,  /*    LIKE_KW => ID */
   26,  /*      MATCH => ID */
   26,  /*        KEY => ID */
   26,  /*         OF => ID */
   26,  /*     OFFSET => ID */
   26,  /*     PRAGMA => ID */
   26,  /*      RAISE => ID */
   26,  /*    REPLACE => ID */
   26,  /*   RESTRICT => ID */
   26,  /*        ROW => ID */
   26,  /*    TRIGGER => ID */
   26,  /*     VACUUM => ID */
   26,  /*       VIEW => ID */
   26,  /*    VIRTUAL => ID */
   26,  /*    REINDEX => ID */
   26,  /*     RENAME => ID */
   26,  /*   CTIME_KW => ID */
    0,  /*        ANY => nothing */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*         IS => nothing */
    0,  /*    BETWEEN => nothing */
    0,  /*         IN => nothing */
    0,  /*     ISNULL => nothing */
    0,  /*    NOTNULL => nothing */
    0,  /*         NE => nothing */
    0,  /*         EQ => nothing */
    0,  /*         GT => nothing */
    0,  /*         LE => nothing */
    0,  /*         LT => nothing */
    0,  /*         GE => nothing */
    0,  /*     ESCAPE => nothing */
    0,  /*     BITAND => nothing */
    0,  /*      BITOR => nothing */
    0,  /*     LSHIFT => nothing */
    0,  /*     RSHIFT => nothing */
    0,  /*       PLUS => nothing */
    0,  /*      MINUS => nothing */
    0,  /*       STAR => nothing */
    0,  /*      SLASH => nothing */
    0,  /*        REM => nothing */
    0,  /*     CONCAT => nothing */
    0,  /*    COLLATE => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     BITNOT => nothing */
    0,  /*     STRING => nothing */
    0,  /*    JOIN_KW => nothing */
    0,  /* CONSTRAINT => nothing */
    0,  /*    DEFAULT => nothing */
    0,  /*       NULL => nothing */
    0,  /*    PRIMARY => nothing */
    0,  /*     UNIQUE => nothing */
    0,  /*      CHECK => nothing */
    0,  /* REFERENCES => nothing */
    0,  /*   AUTOINCR => nothing */
    0,  /*         ON => nothing */
    0,  /*     DELETE => nothing */
    0,  /*     UPDATE => nothing */
    0,  /*     INSERT => nothing */
    0,  /*        SET => nothing */
    0,  /* DEFERRABLE => nothing */
    0,  /*    FOREIGN => nothing */
    0,  /*       DROP => nothing */
    0,  /*      UNION => nothing */
    0,  /*        ALL => nothing */
    0,  /*     EXCEPT => nothing */
    0,  /*  INTERSECT => nothing */
    0,  /*     SELECT => nothing */
    0,  /*   DISTINCT => nothing */
    0,  /*        DOT => nothing */
    0,  /*       FROM => nothing */
    0,  /*       JOIN => nothing */
    0,  /*    INDEXED => nothing */
    0,  /*         BY => nothing */
    0,  /*      USING => nothing */
    0,  /*      ORDER => nothing */
    0,  /*      GROUP => nothing */
    0,  /*     HAVING => nothing */
    0,  /*      LIMIT => nothing */
    0,  /*      WHERE => nothing */
    0,  /*       INTO => nothing */
    0,  /*     VALUES => nothing */
    0,  /*    INTEGER => nothing */
    0,  /*      FLOAT => nothing */
    0,  /*       BLOB => nothing */
    0,  /*   REGISTER => nothing */
    0,  /*   VARIABLE => nothing */
    0,  /*       CASE => nothing */
    0,  /*       WHEN => nothing */
    0,  /*       THEN => nothing */
    0,  /*       ELSE => nothing */
    0,  /*      INDEX => nothing */
    0,  /*      ALTER => nothing */
    0,  /*        ADD => nothing */
    0,  /*   COLUMNKW => nothing */
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the
** parser's stack.  Information stored includes:
**
**   +  The state number for the parser at this level of the stack.
**
**   +  The value of the token stored at this level of the stack.
**      (In other words, the "major" token.)
**
**   +  The semantic value stored at this level of the stack.  This is
**      the information used by the action routines in the grammar.
**      It is sometimes called the "minor" token.
*/
struct yyStackEntry {
  YYACTIONTYPE stateno;  /* The state-number */
  YYCODETYPE major;      /* The major token value.  This is the code
                         ** number for the token at this stack level */
  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
                         ** is the value of the token  */
};
typedef struct yyStackEntry yyStackEntry;

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  int yyidx;                    /* Index of top element in stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyidxMax;                 /* Maximum value of yyidx */
#endif
  int yyerrcnt;                 /* Shifts left before out of the error */
  sqlite3ParserARG_SDECL                /* A place to hold %extra_argument */
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
#endif
};
typedef struct yyParser yyParser;

#ifndef NDEBUG
#include <stdio.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
#endif /* NDEBUG */

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  "$",             "SEMI",          "EXPLAIN",       "QUERY",       
  "PLAN",          "BEGIN",         "TRANSACTION",   "DEFERRED",    
  "IMMEDIATE",     "EXCLUSIVE",     "COMMIT",        "END",         
  "ROLLBACK",      "SAVEPOINT",     "RELEASE",       "TO",          
  "CREATE",        "TABLE",         "IF",            "NOT",         
  "EXISTS",        "TEMP",          "LP",            "RP",          
  "AS",            "COMMA",         "ID",            "ABORT",       
  "AFTER",         "ANALYZE",       "ASC",           "ATTACH",      
  "BEFORE",        "CASCADE",       "CAST",          "CONFLICT",    
  "DATABASE",      "DESC",          "DETACH",        "EACH",        
  "FAIL",          "FOR",           "IGNORE",        "INITIALLY",   
  "INSTEAD",       "LIKE_KW",       "MATCH",         "KEY",         
  "OF",            "OFFSET",        "PRAGMA",        "RAISE",       
  "REPLACE",       "RESTRICT",      "ROW",           "TRIGGER",     
  "VACUUM",        "VIEW",          "VIRTUAL",       "REINDEX",     
  "RENAME",        "CTIME_KW",      "ANY",           "OR",          
  "AND",           "IS",            "BETWEEN",       "IN",          
  "ISNULL",        "NOTNULL",       "NE",            "EQ",          
  "GT",            "LE",            "LT",            "GE",          
  "ESCAPE",        "BITAND",        "BITOR",         "LSHIFT",      
  "RSHIFT",        "PLUS",          "MINUS",         "STAR",        
  "SLASH",         "REM",           "CONCAT",        "COLLATE",     
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
  "PRIMARY",       "UNIQUE",        "CHECK",         "REFERENCES",  
  "AUTOINCR",      "ON",            "DELETE",        "UPDATE",      
  "INSERT",        "SET",           "DEFERRABLE",    "FOREIGN",     
  "DROP",          "UNION",         "ALL",           "EXCEPT",      
  "INTERSECT",     "SELECT",        "DISTINCT",      "DOT",         
  "FROM",          "JOIN",          "INDEXED",       "BY",          
  "USING",         "ORDER",         "GROUP",         "HAVING",      
  "LIMIT",         "WHERE",         "INTO",          "VALUES",      
  "INTEGER",       "FLOAT",         "BLOB",          "REGISTER",    
  "VARIABLE",      "CASE",          "WHEN",          "THEN",        
  "ELSE",          "INDEX",         "ALTER",         "ADD",         
  "COLUMNKW",      "error",         "input",         "cmdlist",     
  "ecmd",          "explain",       "cmdx",          "cmd",         
  "transtype",     "trans_opt",     "nm",            "savepoint_opt",
  "create_table",  "create_table_args",  "temp",          "ifnotexists", 
  "dbnm",          "columnlist",    "conslist_opt",  "select",      
  "column",        "columnid",      "type",          "carglist",    
  "id",            "ids",           "typetoken",     "typename",    
  "signed",        "plus_num",      "minus_num",     "carg",        
  "ccons",         "term",          "expr",          "onconf",      
  "sortorder",     "autoinc",       "idxlist_opt",   "refargs",     
  "defer_subclause",  "refarg",        "refact",        "init_deferred_pred_opt",
  "conslist",      "tcons",         "idxlist",       "defer_subclause_opt",
  "orconf",        "resolvetype",   "raisetype",     "ifexists",    
  "fullname",      "oneselect",     "multiselect_op",  "distinct",    
  "selcollist",    "from",          "where_opt",     "groupby_opt", 
  "having_opt",    "orderby_opt",   "limit_opt",     "sclp",        
  "as",            "seltablist",    "stl_prefix",    "joinop",      
  "indexed_opt",   "on_opt",        "using_opt",     "joinop2",     
  "inscollist",    "sortlist",      "sortitem",      "nexprlist",   
  "setlist",       "insert_cmd",    "inscollist_opt",  "itemlist",    
  "exprlist",      "likeop",        "escape",        "between_op",  
  "in_op",         "case_operand",  "case_exprlist",  "case_else",   
  "uniqueflag",    "collate",       "nmnum",         "plus_opt",    
  "number",        "trigger_decl",  "trigger_cmd_list",  "trigger_time",
  "trigger_event",  "foreach_clause",  "when_clause",   "trigger_cmd", 
  "database_kw_opt",  "key_opt",       "add_column_fullname",  "kwcolumn_opt",
  "create_vtab",   "vtabarglist",   "vtabarg",       "vtabargtoken",
  "lp",            "anylist",     
};
#endif /* NDEBUG */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
 /*   0 */ "input ::= cmdlist",
 /*   1 */ "cmdlist ::= cmdlist ecmd",
 /*   2 */ "cmdlist ::= ecmd",
 /*   3 */ "ecmd ::= SEMI",
 /*   4 */ "ecmd ::= explain cmdx SEMI",
 /*   5 */ "explain ::=",
 /*   6 */ "explain ::= EXPLAIN",
 /*   7 */ "explain ::= EXPLAIN QUERY PLAN",
 /*   8 */ "cmdx ::= cmd",
 /*   9 */ "cmd ::= BEGIN transtype trans_opt",
 /*  10 */ "trans_opt ::=",
 /*  11 */ "trans_opt ::= TRANSACTION",
 /*  12 */ "trans_opt ::= TRANSACTION nm",
 /*  13 */ "transtype ::=",
 /*  14 */ "transtype ::= DEFERRED",
 /*  15 */ "transtype ::= IMMEDIATE",
 /*  16 */ "transtype ::= EXCLUSIVE",
 /*  17 */ "cmd ::= COMMIT trans_opt",
 /*  18 */ "cmd ::= END trans_opt",
 /*  19 */ "cmd ::= ROLLBACK trans_opt",
 /*  20 */ "savepoint_opt ::= SAVEPOINT",
 /*  21 */ "savepoint_opt ::=",
 /*  22 */ "cmd ::= SAVEPOINT nm",
 /*  23 */ "cmd ::= RELEASE savepoint_opt nm",
 /*  24 */ "cmd ::= ROLLBACK trans_opt TO savepoint_opt nm",
 /*  25 */ "cmd ::= create_table create_table_args",
 /*  26 */ "create_table ::= CREATE temp TABLE ifnotexists nm dbnm",
 /*  27 */ "ifnotexists ::=",
 /*  28 */ "ifnotexists ::= IF NOT EXISTS",
 /*  29 */ "temp ::= TEMP",
 /*  30 */ "temp ::=",
 /*  31 */ "create_table_args ::= LP columnlist conslist_opt RP",
 /*  32 */ "create_table_args ::= AS select",
 /*  33 */ "columnlist ::= columnlist COMMA column",
 /*  34 */ "columnlist ::= column",
 /*  35 */ "column ::= columnid type carglist",
 /*  36 */ "columnid ::= nm",
 /*  37 */ "id ::= ID",
 /*  38 */ "ids ::= ID|STRING",
 /*  39 */ "nm ::= ID",
 /*  40 */ "nm ::= STRING",
 /*  41 */ "nm ::= JOIN_KW",
 /*  42 */ "type ::=",
 /*  43 */ "type ::= typetoken",
 /*  44 */ "typetoken ::= typename",
 /*  45 */ "typetoken ::= typename LP signed RP",
 /*  46 */ "typetoken ::= typename LP signed COMMA signed RP",
 /*  47 */ "typename ::= ids",
 /*  48 */ "typename ::= typename ids",
 /*  49 */ "signed ::= plus_num",
 /*  50 */ "signed ::= minus_num",
 /*  51 */ "carglist ::= carglist carg",
 /*  52 */ "carglist ::=",
 /*  53 */ "carg ::= CONSTRAINT nm ccons",
 /*  54 */ "carg ::= ccons",
 /*  55 */ "ccons ::= DEFAULT term",
 /*  56 */ "ccons ::= DEFAULT LP expr RP",
 /*  57 */ "ccons ::= DEFAULT PLUS term",
 /*  58 */ "ccons ::= DEFAULT MINUS term",
 /*  59 */ "ccons ::= DEFAULT id",
 /*  60 */ "ccons ::= NULL onconf",
 /*  61 */ "ccons ::= NOT NULL onconf",
 /*  62 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
 /*  63 */ "ccons ::= UNIQUE onconf",
 /*  64 */ "ccons ::= CHECK LP expr RP",
 /*  65 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
 /*  66 */ "ccons ::= defer_subclause",
 /*  67 */ "ccons ::= COLLATE ids",
 /*  68 */ "autoinc ::=",
 /*  69 */ "autoinc ::= AUTOINCR",
 /*  70 */ "refargs ::=",
 /*  71 */ "refargs ::= refargs refarg",
 /*  72 */ "refarg ::= MATCH nm",
 /*  73 */ "refarg ::= ON DELETE refact",
 /*  74 */ "refarg ::= ON UPDATE refact",
 /*  75 */ "refarg ::= ON INSERT refact",
 /*  76 */ "refact ::= SET NULL",
 /*  77 */ "refact ::= SET DEFAULT",
 /*  78 */ "refact ::= CASCADE",
 /*  79 */ "refact ::= RESTRICT",
 /*  80 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt",
 /*  81 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt",
 /*  82 */ "init_deferred_pred_opt ::=",
 /*  83 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED",
 /*  84 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE",
 /*  85 */ "conslist_opt ::=",
 /*  86 */ "conslist_opt ::= COMMA conslist",
 /*  87 */ "conslist ::= conslist COMMA tcons",
 /*  88 */ "conslist ::= conslist tcons",
 /*  89 */ "conslist ::= tcons",
 /*  90 */ "tcons ::= CONSTRAINT nm",
 /*  91 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
 /*  92 */ "tcons ::= UNIQUE LP idxlist RP onconf",
 /*  93 */ "tcons ::= CHECK LP expr RP onconf",
 /*  94 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
 /*  95 */ "defer_subclause_opt ::=",
 /*  96 */ "defer_subclause_opt ::= defer_subclause",
 /*  97 */ "onconf ::=",
 /*  98 */ "onconf ::= ON CONFLICT resolvetype",
 /*  99 */ "orconf ::=",
 /* 100 */ "orconf ::= OR resolvetype",
 /* 101 */ "resolvetype ::= raisetype",
 /* 102 */ "resolvetype ::= IGNORE",
 /* 103 */ "resolvetype ::= REPLACE",
 /* 104 */ "cmd ::= DROP TABLE ifexists fullname",
 /* 105 */ "ifexists ::= IF EXISTS",
 /* 106 */ "ifexists ::=",
 /* 107 */ "cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select",
 /* 108 */ "cmd ::= DROP VIEW ifexists fullname",
 /* 109 */ "cmd ::= select",
 /* 110 */ "select ::= oneselect",
 /* 111 */ "select ::= select multiselect_op oneselect",
 /* 112 */ "multiselect_op ::= UNION",
 /* 113 */ "multiselect_op ::= UNION ALL",
 /* 114 */ "multiselect_op ::= EXCEPT|INTERSECT",
 /* 115 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
 /* 116 */ "distinct ::= DISTINCT",
 /* 117 */ "distinct ::= ALL",
 /* 118 */ "distinct ::=",
 /* 119 */ "sclp ::= selcollist COMMA",
 /* 120 */ "sclp ::=",
 /* 121 */ "selcollist ::= sclp expr as",
 /* 122 */ "selcollist ::= sclp STAR",
 /* 123 */ "selcollist ::= sclp nm DOT STAR",
 /* 124 */ "as ::= AS nm",
 /* 125 */ "as ::= ids",
 /* 126 */ "as ::=",
 /* 127 */ "from ::=",
 /* 128 */ "from ::= FROM seltablist",
 /* 129 */ "stl_prefix ::= seltablist joinop",
 /* 130 */ "stl_prefix ::=",
 /* 131 */ "seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt",
 /* 132 */ "seltablist ::= stl_prefix LP select RP as on_opt using_opt",
 /* 133 */ "seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt",
 /* 134 */ "dbnm ::=",
 /* 135 */ "dbnm ::= DOT nm",
 /* 136 */ "fullname ::= nm dbnm",
 /* 137 */ "joinop ::= COMMA|JOIN",
 /* 138 */ "joinop ::= JOIN_KW JOIN",
 /* 139 */ "joinop ::= JOIN_KW nm JOIN",
 /* 140 */ "joinop ::= JOIN_KW nm nm JOIN",
 /* 141 */ "on_opt ::= ON expr",
 /* 142 */ "on_opt ::=",
 /* 143 */ "indexed_opt ::=",
 /* 144 */ "indexed_opt ::= INDEXED BY nm",
 /* 145 */ "indexed_opt ::= NOT INDEXED",
 /* 146 */ "using_opt ::= USING LP inscollist RP",
 /* 147 */ "using_opt ::=",
 /* 148 */ "orderby_opt ::=",
 /* 149 */ "orderby_opt ::= ORDER BY sortlist",
 /* 150 */ "sortlist ::= sortlist COMMA sortitem sortorder",
 /* 151 */ "sortlist ::= sortitem sortorder",
 /* 152 */ "sortitem ::= expr",
 /* 153 */ "sortorder ::= ASC",
 /* 154 */ "sortorder ::= DESC",
 /* 155 */ "sortorder ::=",
 /* 156 */ "groupby_opt ::=",
 /* 157 */ "groupby_opt ::= GROUP BY nexprlist",
 /* 158 */ "having_opt ::=",
 /* 159 */ "having_opt ::= HAVING expr",
 /* 160 */ "limit_opt ::=",
 /* 161 */ "limit_opt ::= LIMIT expr",
 /* 162 */ "limit_opt ::= LIMIT expr OFFSET expr",
 /* 163 */ "limit_opt ::= LIMIT expr COMMA expr",
 /* 164 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt",
 /* 165 */ "where_opt ::=",
 /* 166 */ "where_opt ::= WHERE expr",
 /* 167 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt",
 /* 168 */ "setlist ::= setlist COMMA nm EQ expr",
 /* 169 */ "setlist ::= nm EQ expr",
 /* 170 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP",
 /* 171 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select",
 /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES",
 /* 173 */ "insert_cmd ::= INSERT orconf",
 /* 174 */ "insert_cmd ::= REPLACE",
 /* 175 */ "itemlist ::= itemlist COMMA expr",
 /* 176 */ "itemlist ::= expr",
 /* 177 */ "inscollist_opt ::=",
 /* 178 */ "inscollist_opt ::= LP inscollist RP",
 /* 179 */ "inscollist ::= inscollist COMMA nm",
 /* 180 */ "inscollist ::= nm",
 /* 181 */ "expr ::= term",
 /* 182 */ "expr ::= LP expr RP",
 /* 183 */ "term ::= NULL",
 /* 184 */ "expr ::= ID",
 /* 185 */ "expr ::= JOIN_KW",
 /* 186 */ "expr ::= nm DOT nm",
 /* 187 */ "expr ::= nm DOT nm DOT nm",
 /* 188 */ "term ::= INTEGER|FLOAT|BLOB",
 /* 189 */ "term ::= STRING",
 /* 190 */ "expr ::= REGISTER",
 /* 191 */ "expr ::= VARIABLE",
 /* 192 */ "expr ::= expr COLLATE ids",
 /* 193 */ "expr ::= CAST LP expr AS typetoken RP",
 /* 194 */ "expr ::= ID LP distinct exprlist RP",
 /* 195 */ "expr ::= ID LP STAR RP",
 /* 196 */ "term ::= CTIME_KW",
 /* 197 */ "expr ::= expr AND expr",
 /* 198 */ "expr ::= expr OR expr",
 /* 199 */ "expr ::= expr LT|GT|GE|LE expr",
 /* 200 */ "expr ::= expr EQ|NE expr",
 /* 201 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
 /* 202 */ "expr ::= expr PLUS|MINUS expr",
 /* 203 */ "expr ::= expr STAR|SLASH|REM expr",
 /* 204 */ "expr ::= expr CONCAT expr",
 /* 205 */ "likeop ::= LIKE_KW",
 /* 206 */ "likeop ::= NOT LIKE_KW",
 /* 207 */ "likeop ::= MATCH",
 /* 208 */ "likeop ::= NOT MATCH",
 /* 209 */ "escape ::= ESCAPE expr",
 /* 210 */ "escape ::=",
 /* 211 */ "expr ::= expr likeop expr escape",
 /* 212 */ "expr ::= expr ISNULL|NOTNULL",
 /* 213 */ "expr ::= expr IS NULL",
 /* 214 */ "expr ::= expr NOT NULL",
 /* 215 */ "expr ::= expr IS NOT NULL",
 /* 216 */ "expr ::= NOT expr",
 /* 217 */ "expr ::= BITNOT expr",
 /* 218 */ "expr ::= MINUS expr",
 /* 219 */ "expr ::= PLUS expr",
 /* 220 */ "between_op ::= BETWEEN",
 /* 221 */ "between_op ::= NOT BETWEEN",
 /* 222 */ "expr ::= expr between_op expr AND expr",
 /* 223 */ "in_op ::= IN",
 /* 224 */ "in_op ::= NOT IN",
 /* 225 */ "expr ::= expr in_op LP exprlist RP",
 /* 226 */ "expr ::= LP select RP",
 /* 227 */ "expr ::= expr in_op LP select RP",
 /* 228 */ "expr ::= expr in_op nm dbnm",
 /* 229 */ "expr ::= EXISTS LP select RP",
 /* 230 */ "expr ::= CASE case_operand case_exprlist case_else END",
 /* 231 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
 /* 232 */ "case_exprlist ::= WHEN expr THEN expr",
 /* 233 */ "case_else ::= ELSE expr",
 /* 234 */ "case_else ::=",
 /* 235 */ "case_operand ::= expr",
 /* 236 */ "case_operand ::=",
 /* 237 */ "exprlist ::= nexprlist",
 /* 238 */ "exprlist ::=",
 /* 239 */ "nexprlist ::= nexprlist COMMA expr",
 /* 240 */ "nexprlist ::= expr",
 /* 241 */ "cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP",
 /* 242 */ "uniqueflag ::= UNIQUE",
 /* 243 */ "uniqueflag ::=",
 /* 244 */ "idxlist_opt ::=",
 /* 245 */ "idxlist_opt ::= LP idxlist RP",
 /* 246 */ "idxlist ::= idxlist COMMA nm collate sortorder",
 /* 247 */ "idxlist ::= nm collate sortorder",
 /* 248 */ "collate ::=",
 /* 249 */ "collate ::= COLLATE ids",
 /* 250 */ "cmd ::= DROP INDEX ifexists fullname",
 /* 251 */ "cmd ::= VACUUM",
 /* 252 */ "cmd ::= VACUUM nm",
 /* 253 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
 /* 254 */ "cmd ::= PRAGMA nm dbnm EQ ON",
 /* 255 */ "cmd ::= PRAGMA nm dbnm EQ DELETE",
 /* 256 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
 /* 257 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
 /* 258 */ "cmd ::= PRAGMA nm dbnm",
 /* 259 */ "nmnum ::= plus_num",
 /* 260 */ "nmnum ::= nm",
 /* 261 */ "plus_num ::= plus_opt number",
 /* 262 */ "minus_num ::= MINUS number",
 /* 263 */ "number ::= INTEGER|FLOAT",
 /* 264 */ "plus_opt ::= PLUS",
 /* 265 */ "plus_opt ::=",
 /* 266 */ "cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END",
 /* 267 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
 /* 268 */ "trigger_time ::= BEFORE",
 /* 269 */ "trigger_time ::= AFTER",
 /* 270 */ "trigger_time ::= INSTEAD OF",
 /* 271 */ "trigger_time ::=",
 /* 272 */ "trigger_event ::= DELETE|INSERT",
 /* 273 */ "trigger_event ::= UPDATE",
 /* 274 */ "trigger_event ::= UPDATE OF inscollist",
 /* 275 */ "foreach_clause ::=",
 /* 276 */ "foreach_clause ::= FOR EACH ROW",
 /* 277 */ "when_clause ::=",
 /* 278 */ "when_clause ::= WHEN expr",
 /* 279 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
 /* 280 */ "trigger_cmd_list ::= trigger_cmd SEMI",
 /* 281 */ "trigger_cmd ::= UPDATE orconf nm SET setlist where_opt",
 /* 282 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP",
 /* 283 */ "trigger_cmd ::= insert_cmd INTO nm inscollist_opt select",
 /* 284 */ "trigger_cmd ::= DELETE FROM nm where_opt",
 /* 285 */ "trigger_cmd ::= select",
 /* 286 */ "expr ::= RAISE LP IGNORE RP",
 /* 287 */ "expr ::= RAISE LP raisetype COMMA nm RP",
 /* 288 */ "raisetype ::= ROLLBACK",
 /* 289 */ "raisetype ::= ABORT",
 /* 290 */ "raisetype ::= FAIL",
 /* 291 */ "cmd ::= DROP TRIGGER ifexists fullname",
 /* 292 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
 /* 293 */ "cmd ::= DETACH database_kw_opt expr",
 /* 294 */ "key_opt ::=",
 /* 295 */ "key_opt ::= KEY expr",
 /* 296 */ "database_kw_opt ::= DATABASE",
 /* 297 */ "database_kw_opt ::=",
 /* 298 */ "cmd ::= REINDEX",
 /* 299 */ "cmd ::= REINDEX nm dbnm",
 /* 300 */ "cmd ::= ANALYZE",
 /* 301 */ "cmd ::= ANALYZE nm dbnm",
 /* 302 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
 /* 303 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column",
 /* 304 */ "add_column_fullname ::= fullname",
 /* 305 */ "kwcolumn_opt ::=",
 /* 306 */ "kwcolumn_opt ::= COLUMNKW",
 /* 307 */ "cmd ::= create_vtab",
 /* 308 */ "cmd ::= create_vtab LP vtabarglist RP",
 /* 309 */ "create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm",
 /* 310 */ "vtabarglist ::= vtabarg",
 /* 311 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
 /* 312 */ "vtabarg ::=",
 /* 313 */ "vtabarg ::= vtabarg vtabargtoken",
 /* 314 */ "vtabargtoken ::= ANY",
 /* 315 */ "vtabargtoken ::= lp anylist RP",
 /* 316 */ "lp ::= LP",
 /* 317 */ "anylist ::=",
 /* 318 */ "anylist ::= anylist ANY",
};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.
*/
static void yyGrowStack(yyParser *p){
  int newSize;
  yyStackEntry *pNew;

  newSize = p->yystksz*2 + 100;
  pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  if( pNew ){
    p->yystack = pNew;
    p->yystksz = newSize;
#ifndef NDEBUG
    if( yyTraceFILE ){
      fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
              yyTracePrompt, p->yystksz);
    }
#endif
  }
}
#endif

/* 
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser.  This pointer is used in subsequent calls
** to sqlite3Parser and sqlite3ParserFree.
*/
void *sqlite3ParserAlloc(void *(*mallocProc)(size_t)){
  yyParser *pParser;
  pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
  if( pParser ){
    pParser->yyidx = -1;
#ifdef YYTRACKMAXSTACKDEPTH
    pParser->yyidxMax = 0;
#endif
#if YYSTACKDEPTH<=0
    pParser->yystack = NULL;
    pParser->yystksz = 0;
    yyGrowStack(pParser);
#endif
  }
  return pParser;
}

/* The following function deletes the value associated with a
** symbol.  The symbol can be either a terminal or nonterminal.
** "yymajor" is the symbol code, and "yypminor" is a pointer to
** the value.
*/
static void yy_destructor(
  yyParser *yypParser,    /* The parser */
  YYCODETYPE yymajor,     /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
  sqlite3ParserARG_FETCH;
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are not used
    ** inside the C code.
    */
    case 159: /* select */
    case 193: /* oneselect */
{
#line 384 "parse.y"
sqlite3SelectDelete(pParse->db, (yypminor->yy159));
#line 1310 "parse.c"
}
      break;
    case 173: /* term */
    case 174: /* expr */
    case 198: /* where_opt */
    case 200: /* having_opt */
    case 209: /* on_opt */
    case 214: /* sortitem */
    case 222: /* escape */
    case 225: /* case_operand */
    case 227: /* case_else */
    case 238: /* when_clause */
    case 241: /* key_opt */
{
#line 695 "parse.y"
sqlite3ExprDelete(pParse->db, (yypminor->yy122));
#line 1327 "parse.c"
}
      break;
    case 178: /* idxlist_opt */
    case 186: /* idxlist */
    case 196: /* selcollist */
    case 199: /* groupby_opt */
    case 201: /* orderby_opt */
    case 203: /* sclp */
    case 213: /* sortlist */
    case 215: /* nexprlist */
    case 216: /* setlist */
    case 219: /* itemlist */
    case 220: /* exprlist */
    case 226: /* case_exprlist */
{
#line 953 "parse.y"
sqlite3ExprListDelete(pParse->db, (yypminor->yy442));
#line 1345 "parse.c"
}
      break;
    case 192: /* fullname */
    case 197: /* from */
    case 205: /* seltablist */
    case 206: /* stl_prefix */
{
#line 513 "parse.y"
sqlite3SrcListDelete(pParse->db, (yypminor->yy347));
#line 1355 "parse.c"
}
      break;
    case 210: /* using_opt */
    case 212: /* inscollist */
    case 218: /* inscollist_opt */
{
#line 545 "parse.y"
sqlite3IdListDelete(pParse->db, (yypminor->yy180));
#line 1364 "parse.c"
}
      break;
    case 234: /* trigger_cmd_list */
    case 239: /* trigger_cmd */
{
#line 1057 "parse.y"
sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy327));
#line 1372 "parse.c"
}
      break;
    case 236: /* trigger_event */
{
#line 1043 "parse.y"
sqlite3IdListDelete(pParse->db, (yypminor->yy410).b);
#line 1379 "parse.c"
}
      break;
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/
static int yy_pop_parser_stack(yyParser *pParser){
  YYCODETYPE yymajor;
  yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];

  if( pParser->yyidx<0 ) return 0;
#ifndef NDEBUG
  if( yyTraceFILE && pParser->yyidx>=0 ){
    fprintf(yyTraceFILE,"%sPopping %s\n",
      yyTracePrompt,
      yyTokenName[yytos->major]);
  }
#endif
  yymajor = yytos->major;
  yy_destructor(pParser, yymajor, &yytos->minor);
  pParser->yyidx--;
  return yymajor;
}

/* 
** Deallocate and destroy a parser.  Destructors are all called for
** all stack elements before shutting the parser down.
**
** Inputs:
** <ul>
** <li>  A pointer to the parser.  This should be a pointer
**       obtained from sqlite3ParserAlloc.
** <li>  A pointer to a function used to reclaim memory obtained
**       from malloc.
** </ul>
*/
void sqlite3ParserFree(
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
  yyParser *pParser = (yyParser*)p;
  if( pParser==0 ) return;
  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
  free(pParser->yystack);
#endif
  (*freeProc)((void*)pParser);
}

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
int sqlite3ParserStackPeak(void *p){
  yyParser *pParser = (yyParser*)p;
  return pParser->yyidxMax;
}
#endif

/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead.  If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_shift_action(
  yyParser *pParser,        /* The parser */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
  int stateno = pParser->yystack[pParser->yyidx].stateno;
 
  if( stateno>YY_SHIFT_MAX || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
    return yy_default[stateno];
  }
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
    if( iLookAhead>0 ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        return yy_find_shift_action(pParser, iFallback);
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
        if( j>=0 && j<YY_SZ_ACTTAB && yy_lookahead[j]==YYWILDCARD ){
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
    }
    return yy_default[stateno];
  }else{
    return yy_action[i];
  }
}

/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead.  If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_reduce_action(
  int stateno,              /* Current state number */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
#ifdef YYERRORSYMBOL
  if( stateno>YY_REDUCE_MAX ){
    return yy_default[stateno];
  }
#else
  assert( stateno<=YY_REDUCE_MAX );
#endif
  i = yy_reduce_ofst[stateno];
  assert( i!=YY_REDUCE_USE_DFLT );
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
#ifdef YYERRORSYMBOL
  if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
    return yy_default[stateno];
  }
#else
  assert( i>=0 && i<YY_SZ_ACTTAB );
  assert( yy_lookahead[i]==iLookAhead );
#endif
  return yy_action[i];
}

/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
   sqlite3ParserARG_FETCH;
   yypParser->yyidx--;
#ifndef NDEBUG
   if( yyTraceFILE ){
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   }
#endif
   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
   /* Here code is inserted which will execute if the parser
   ** stack every overflows */
#line 40 "parse.y"

  UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */
  sqlite3ErrorMsg(pParse, "parser stack overflow");
  pParse->parseError = 1;
#line 1557 "parse.c"
   sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument var */
}

/*
** Perform a shift action.
*/
static void yy_shift(
  yyParser *yypParser,          /* The parser to be shifted */
  int yyNewState,               /* The new state to shift in */
  int yyMajor,                  /* The major token to shift in */
  YYMINORTYPE *yypMinor         /* Pointer to the minor token to shift in */
){
  yyStackEntry *yytos;
  yypParser->yyidx++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( yypParser->yyidx>yypParser->yyidxMax ){
    yypParser->yyidxMax = yypParser->yyidx;
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yyidx>=YYSTACKDEPTH ){
    yyStackOverflow(yypParser, yypMinor);
    return;
  }
#else
  if( yypParser->yyidx>=yypParser->yystksz ){
    yyGrowStack(yypParser);
    if( yypParser->yyidx>=yypParser->yystksz ){
      yyStackOverflow(yypParser, yypMinor);
      return;
    }
  }
#endif
  yytos = &yypParser->yystack[yypParser->yyidx];
  yytos->stateno = (YYACTIONTYPE)yyNewState;
  yytos->major = (YYCODETYPE)yyMajor;
  yytos->minor = *yypMinor;
#ifndef NDEBUG
  if( yyTraceFILE && yypParser->yyidx>0 ){
    int i;
    fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
    fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
    for(i=1; i<=yypParser->yyidx; i++)
      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
    fprintf(yyTraceFILE,"\n");
  }
#endif
}

/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
  { 142, 1 },
  { 143, 2 },
  { 143, 1 },
  { 144, 1 },
  { 144, 3 },
  { 145, 0 },
  { 145, 1 },
  { 145, 3 },
  { 146, 1 },
  { 147, 3 },
  { 149, 0 },
  { 149, 1 },
  { 149, 2 },
  { 148, 0 },
  { 148, 1 },
  { 148, 1 },
  { 148, 1 },
  { 147, 2 },
  { 147, 2 },
  { 147, 2 },
  { 151, 1 },
  { 151, 0 },
  { 147, 2 },
  { 147, 3 },
  { 147, 5 },
  { 147, 2 },
  { 152, 6 },
  { 155, 0 },
  { 155, 3 },
  { 154, 1 },
  { 154, 0 },
  { 153, 4 },
  { 153, 2 },
  { 157, 3 },
  { 157, 1 },
  { 160, 3 },
  { 161, 1 },
  { 164, 1 },
  { 165, 1 },
  { 150, 1 },
  { 150, 1 },
  { 150, 1 },
  { 162, 0 },
  { 162, 1 },
  { 166, 1 },
  { 166, 4 },
  { 166, 6 },
  { 167, 1 },
  { 167, 2 },
  { 168, 1 },
  { 168, 1 },
  { 163, 2 },
  { 163, 0 },
  { 171, 3 },
  { 171, 1 },
  { 172, 2 },
  { 172, 4 },
  { 172, 3 },
  { 172, 3 },
  { 172, 2 },
  { 172, 2 },
  { 172, 3 },
  { 172, 5 },
  { 172, 2 },
  { 172, 4 },
  { 172, 4 },
  { 172, 1 },
  { 172, 2 },
  { 177, 0 },
  { 177, 1 },
  { 179, 0 },
  { 179, 2 },
  { 181, 2 },
  { 181, 3 },
  { 181, 3 },
  { 181, 3 },
  { 182, 2 },
  { 182, 2 },
  { 182, 1 },
  { 182, 1 },
  { 180, 3 },
  { 180, 2 },
  { 183, 0 },
  { 183, 2 },
  { 183, 2 },
  { 158, 0 },
  { 158, 2 },
  { 184, 3 },
  { 184, 2 },
  { 184, 1 },
  { 185, 2 },
  { 185, 7 },
  { 185, 5 },
  { 185, 5 },
  { 185, 10 },
  { 187, 0 },
  { 187, 1 },
  { 175, 0 },
  { 175, 3 },
  { 188, 0 },
  { 188, 2 },
  { 189, 1 },
  { 189, 1 },
  { 189, 1 },
  { 147, 4 },
  { 191, 2 },
  { 191, 0 },
  { 147, 8 },
  { 147, 4 },
  { 147, 1 },
  { 159, 1 },
  { 159, 3 },
  { 194, 1 },
  { 194, 2 },
  { 194, 1 },
  { 193, 9 },
  { 195, 1 },
  { 195, 1 },
  { 195, 0 },
  { 203, 2 },
  { 203, 0 },
  { 196, 3 },
  { 196, 2 },
  { 196, 4 },
  { 204, 2 },
  { 204, 1 },
  { 204, 0 },
  { 197, 0 },
  { 197, 2 },
  { 206, 2 },
  { 206, 0 },
  { 205, 7 },
  { 205, 7 },
  { 205, 7 },
  { 156, 0 },
  { 156, 2 },
  { 192, 2 },
  { 207, 1 },
  { 207, 2 },
  { 207, 3 },
  { 207, 4 },
  { 209, 2 },
  { 209, 0 },
  { 208, 0 },
  { 208, 3 },
  { 208, 2 },
  { 210, 4 },
  { 210, 0 },
  { 201, 0 },
  { 201, 3 },
  { 213, 4 },
  { 213, 2 },
  { 214, 1 },
  { 176, 1 },
  { 176, 1 },
  { 176, 0 },
  { 199, 0 },
  { 199, 3 },
  { 200, 0 },
  { 200, 2 },
  { 202, 0 },
  { 202, 2 },
  { 202, 4 },
  { 202, 4 },
  { 147, 5 },
  { 198, 0 },
  { 198, 2 },
  { 147, 7 },
  { 216, 5 },
  { 216, 3 },
  { 147, 8 },
  { 147, 5 },
  { 147, 6 },
  { 217, 2 },
  { 217, 1 },
  { 219, 3 },
  { 219, 1 },
  { 218, 0 },
  { 218, 3 },
  { 212, 3 },
  { 212, 1 },
  { 174, 1 },
  { 174, 3 },
  { 173, 1 },
  { 174, 1 },
  { 174, 1 },
  { 174, 3 },
  { 174, 5 },
  { 173, 1 },
  { 173, 1 },
  { 174, 1 },
  { 174, 1 },
  { 174, 3 },
  { 174, 6 },
  { 174, 5 },
  { 174, 4 },
  { 173, 1 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 174, 3 },
  { 221, 1 },
  { 221, 2 },
  { 221, 1 },
  { 221, 2 },
  { 222, 2 },
  { 222, 0 },
  { 174, 4 },
  { 174, 2 },
  { 174, 3 },
  { 174, 3 },
  { 174, 4 },
  { 174, 2 },
  { 174, 2 },
  { 174, 2 },
  { 174, 2 },
  { 223, 1 },
  { 223, 2 },
  { 174, 5 },
  { 224, 1 },
  { 224, 2 },
  { 174, 5 },
  { 174, 3 },
  { 174, 5 },
  { 174, 4 },
  { 174, 4 },
  { 174, 5 },
  { 226, 5 },
  { 226, 4 },
  { 227, 2 },
  { 227, 0 },
  { 225, 1 },
  { 225, 0 },
  { 220, 1 },
  { 220, 0 },
  { 215, 3 },
  { 215, 1 },
  { 147, 11 },
  { 228, 1 },
  { 228, 0 },
  { 178, 0 },
  { 178, 3 },
  { 186, 5 },
  { 186, 3 },
  { 229, 0 },
  { 229, 2 },
  { 147, 4 },
  { 147, 1 },
  { 147, 2 },
  { 147, 5 },
  { 147, 5 },
  { 147, 5 },
  { 147, 5 },
  { 147, 6 },
  { 147, 3 },
  { 230, 1 },
  { 230, 1 },
  { 169, 2 },
  { 170, 2 },
  { 232, 1 },
  { 231, 1 },
  { 231, 0 },
  { 147, 5 },
  { 233, 11 },
  { 235, 1 },
  { 235, 1 },
  { 235, 2 },
  { 235, 0 },
  { 236, 1 },
  { 236, 1 },
  { 236, 3 },
  { 237, 0 },
  { 237, 3 },
  { 238, 0 },
  { 238, 2 },
  { 234, 3 },
  { 234, 2 },
  { 239, 6 },
  { 239, 8 },
  { 239, 5 },
  { 239, 4 },
  { 239, 1 },
  { 174, 4 },
  { 174, 6 },
  { 190, 1 },
  { 190, 1 },
  { 190, 1 },
  { 147, 4 },
  { 147, 6 },
  { 147, 3 },
  { 241, 0 },
  { 241, 2 },
  { 240, 1 },
  { 240, 0 },
  { 147, 1 },
  { 147, 3 },
  { 147, 1 },
  { 147, 3 },
  { 147, 6 },
  { 147, 6 },
  { 242, 1 },
  { 243, 0 },
  { 243, 1 },
  { 147, 1 },
  { 147, 4 },
  { 244, 7 },
  { 245, 1 },
  { 245, 3 },
  { 246, 0 },
  { 246, 2 },
  { 247, 1 },
  { 247, 3 },
  { 248, 1 },
  { 249, 0 },
  { 249, 2 },
};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void yy_reduce(
  yyParser *yypParser,         /* The parser */
  int yyruleno                 /* Number of the rule by which to reduce */
){
  int yygoto;                     /* The next state */
  int yyact;                      /* The next action */
  YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
  sqlite3ParserARG_FETCH;
  yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno>=0 
        && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
    fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
      yyRuleName[yyruleno]);
  }
#endif /* NDEBUG */

  /* Silence complaints from purify about yygotominor being uninitialized
  ** in some cases when it is copied into the stack after the following
  ** switch.  yygotominor is uninitialized when a rule reduces that does
  ** not set the value of its left-hand side nonterminal.  Leaving the
  ** value of the nonterminal uninitialized is utterly harmless as long
  ** as the value is never used.  So really the only thing this code
  ** accomplishes is to quieten purify.  
  **
  ** 2007-01-16:  The wireshark project (www.wireshark.org) reports that
  ** without this code, their parser segfaults.  I'm not sure what there
  ** parser is doing to make this happen.  This is the second bug report
  ** from wireshark this week.  Clearly they are stressing Lemon in ways
  ** that it has not been previously stressed...  (SQLite ticket #2172)
  */
  /*memset(&yygotominor, 0, sizeof(yygotominor));*/
  yygotominor = yyzerominor;


  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
      case 0: /* input ::= cmdlist */
      case 1: /* cmdlist ::= cmdlist ecmd */
      case 2: /* cmdlist ::= ecmd */
      case 3: /* ecmd ::= SEMI */
      case 4: /* ecmd ::= explain cmdx SEMI */
      case 10: /* trans_opt ::= */
      case 11: /* trans_opt ::= TRANSACTION */
      case 12: /* trans_opt ::= TRANSACTION nm */
      case 20: /* savepoint_opt ::= SAVEPOINT */
      case 21: /* savepoint_opt ::= */
      case 25: /* cmd ::= create_table create_table_args */
      case 33: /* columnlist ::= columnlist COMMA column */
      case 34: /* columnlist ::= column */
      case 42: /* type ::= */
      case 49: /* signed ::= plus_num */
      case 50: /* signed ::= minus_num */
      case 51: /* carglist ::= carglist carg */
      case 52: /* carglist ::= */
      case 53: /* carg ::= CONSTRAINT nm ccons */
      case 54: /* carg ::= ccons */
      case 60: /* ccons ::= NULL onconf */
      case 87: /* conslist ::= conslist COMMA tcons */
      case 88: /* conslist ::= conslist tcons */
      case 89: /* conslist ::= tcons */
      case 90: /* tcons ::= CONSTRAINT nm */
      case 264: /* plus_opt ::= PLUS */
      case 265: /* plus_opt ::= */
      case 275: /* foreach_clause ::= */
      case 276: /* foreach_clause ::= FOR EACH ROW */
      case 296: /* database_kw_opt ::= DATABASE */
      case 297: /* database_kw_opt ::= */
      case 305: /* kwcolumn_opt ::= */
      case 306: /* kwcolumn_opt ::= COLUMNKW */
      case 310: /* vtabarglist ::= vtabarg */
      case 311: /* vtabarglist ::= vtabarglist COMMA vtabarg */
      case 313: /* vtabarg ::= vtabarg vtabargtoken */
      case 317: /* anylist ::= */
#line 93 "parse.y"
{
}
#line 2027 "parse.c"
        break;
      case 5: /* explain ::= */
#line 98 "parse.y"
{ sqlite3BeginParse(pParse, 0); }
#line 2032 "parse.c"
        break;
      case 6: /* explain ::= EXPLAIN */
#line 100 "parse.y"
{ sqlite3BeginParse(pParse, 1); }
#line 2037 "parse.c"
        break;
      case 7: /* explain ::= EXPLAIN QUERY PLAN */
#line 101 "parse.y"
{ sqlite3BeginParse(pParse, 2); }
#line 2042 "parse.c"
        break;
      case 8: /* cmdx ::= cmd */
#line 103 "parse.y"
{ sqlite3FinishCoding(pParse); }
#line 2047 "parse.c"
        break;
      case 9: /* cmd ::= BEGIN transtype trans_opt */
#line 108 "parse.y"
{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy392);}
#line 2052 "parse.c"
        break;
      case 13: /* transtype ::= */
#line 113 "parse.y"
{yygotominor.yy392 = TK_DEFERRED;}
#line 2057 "parse.c"
        break;
      case 14: /* transtype ::= DEFERRED */
      case 15: /* transtype ::= IMMEDIATE */
      case 16: /* transtype ::= EXCLUSIVE */
      case 112: /* multiselect_op ::= UNION */
      case 114: /* multiselect_op ::= EXCEPT|INTERSECT */
#line 114 "parse.y"
{yygotominor.yy392 = yymsp[0].major;}
#line 2066 "parse.c"
        break;
      case 17: /* cmd ::= COMMIT trans_opt */
      case 18: /* cmd ::= END trans_opt */
#line 117 "parse.y"
{sqlite3CommitTransaction(pParse);}
#line 2072 "parse.c"
        break;
      case 19: /* cmd ::= ROLLBACK trans_opt */
#line 119 "parse.y"
{sqlite3RollbackTransaction(pParse);}
#line 2077 "parse.c"
        break;
      case 22: /* cmd ::= SAVEPOINT nm */
#line 123 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &yymsp[0].minor.yy0);
}
#line 2084 "parse.c"
        break;
      case 23: /* cmd ::= RELEASE savepoint_opt nm */
#line 126 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &yymsp[0].minor.yy0);
}
#line 2091 "parse.c"
        break;
      case 24: /* cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
#line 129 "parse.y"
{
  sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0);
}
#line 2098 "parse.c"
        break;
      case 26: /* create_table ::= CREATE temp TABLE ifnotexists nm dbnm */
#line 136 "parse.y"
{
   sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy392,0,0,yymsp[-2].minor.yy392);
}
#line 2105 "parse.c"
        break;
      case 27: /* ifnotexists ::= */
      case 30: /* temp ::= */
      case 68: /* autoinc ::= */
      case 82: /* init_deferred_pred_opt ::= */
      case 84: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
      case 95: /* defer_subclause_opt ::= */
      case 106: /* ifexists ::= */
      case 117: /* distinct ::= ALL */
      case 118: /* distinct ::= */
      case 220: /* between_op ::= BETWEEN */
      case 223: /* in_op ::= IN */
#line 140 "parse.y"
{yygotominor.yy392 = 0;}
#line 2120 "parse.c"
        break;
      case 28: /* ifnotexists ::= IF NOT EXISTS */
      case 29: /* temp ::= TEMP */
      case 69: /* autoinc ::= AUTOINCR */
      case 83: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
      case 105: /* ifexists ::= IF EXISTS */
      case 116: /* distinct ::= DISTINCT */
      case 221: /* between_op ::= NOT BETWEEN */
      case 224: /* in_op ::= NOT IN */
#line 141 "parse.y"
{yygotominor.yy392 = 1;}
#line 2132 "parse.c"
        break;
      case 31: /* create_table_args ::= LP columnlist conslist_opt RP */
#line 147 "parse.y"
{
  sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0);
}
#line 2139 "parse.c"
        break;
      case 32: /* create_table_args ::= AS select */
#line 150 "parse.y"
{
  sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy159);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159);
}
#line 2147 "parse.c"
        break;
      case 35: /* column ::= columnid type carglist */
#line 162 "parse.y"
{
  yygotominor.yy0.z = yymsp[-2].minor.yy0.z;
  yygotominor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-2].minor.yy0.z) + pParse->sLastToken.n;
}
#line 2155 "parse.c"
        break;
      case 36: /* columnid ::= nm */
#line 166 "parse.y"
{
  sqlite3AddColumn(pParse,&yymsp[0].minor.yy0);
  yygotominor.yy0 = yymsp[0].minor.yy0;
}
#line 2163 "parse.c"
        break;
      case 37: /* id ::= ID */
      case 38: /* ids ::= ID|STRING */
      case 39: /* nm ::= ID */
      case 40: /* nm ::= STRING */
      case 41: /* nm ::= JOIN_KW */
      case 44: /* typetoken ::= typename */
      case 47: /* typename ::= ids */
      case 124: /* as ::= AS nm */
      case 125: /* as ::= ids */
      case 135: /* dbnm ::= DOT nm */
      case 144: /* indexed_opt ::= INDEXED BY nm */
      case 249: /* collate ::= COLLATE ids */
      case 259: /* nmnum ::= plus_num */
      case 260: /* nmnum ::= nm */
      case 261: /* plus_num ::= plus_opt number */
      case 262: /* minus_num ::= MINUS number */
      case 263: /* number ::= INTEGER|FLOAT */
#line 176 "parse.y"
{yygotominor.yy0 = yymsp[0].minor.yy0;}
#line 2184 "parse.c"
        break;
      case 43: /* type ::= typetoken */
#line 237 "parse.y"
{sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);}
#line 2189 "parse.c"
        break;
      case 45: /* typetoken ::= typename LP signed RP */
#line 239 "parse.y"
{
  yygotominor.yy0.z = yymsp[-3].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-3].minor.yy0.z);
}
#line 2197 "parse.c"
        break;
      case 46: /* typetoken ::= typename LP signed COMMA signed RP */
#line 243 "parse.y"
{
  yygotominor.yy0.z = yymsp[-5].minor.yy0.z;
  yygotominor.yy0.n = (int)(&yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] - yymsp[-5].minor.yy0.z);
}
#line 2205 "parse.c"
        break;
      case 48: /* typename ::= typename ids */
#line 249 "parse.y"
{yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);}
#line 2210 "parse.c"
        break;
      case 55: /* ccons ::= DEFAULT term */
      case 57: /* ccons ::= DEFAULT PLUS term */
#line 260 "parse.y"
{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy122);}
#line 2216 "parse.c"
        break;
      case 56: /* ccons ::= DEFAULT LP expr RP */
#line 261 "parse.y"
{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy122);}
#line 2221 "parse.c"
        break;
      case 58: /* ccons ::= DEFAULT MINUS term */
#line 263 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(p,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
  sqlite3AddDefaultValue(pParse,p);
}
#line 2230 "parse.c"
        break;
      case 59: /* ccons ::= DEFAULT id */
#line 268 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &yymsp[0].minor.yy0);
  sqlite3AddDefaultValue(pParse,p);
}
#line 2238 "parse.c"
        break;
      case 61: /* ccons ::= NOT NULL onconf */
#line 277 "parse.y"
{sqlite3AddNotNull(pParse, yymsp[0].minor.yy392);}
#line 2243 "parse.c"
        break;
      case 62: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
#line 279 "parse.y"
{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy392,yymsp[0].minor.yy392,yymsp[-2].minor.yy392);}
#line 2248 "parse.c"
        break;
      case 63: /* ccons ::= UNIQUE onconf */
#line 280 "parse.y"
{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy392,0,0,0,0);}
#line 2253 "parse.c"
        break;
      case 64: /* ccons ::= CHECK LP expr RP */
#line 281 "parse.y"
{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy122);}
#line 2258 "parse.c"
        break;
      case 65: /* ccons ::= REFERENCES nm idxlist_opt refargs */
#line 283 "parse.y"
{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy442,yymsp[0].minor.yy392);}
#line 2263 "parse.c"
        break;
      case 66: /* ccons ::= defer_subclause */
#line 284 "parse.y"
{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy392);}
#line 2268 "parse.c"
        break;
      case 67: /* ccons ::= COLLATE ids */
#line 285 "parse.y"
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
#line 2273 "parse.c"
        break;
      case 70: /* refargs ::= */
#line 298 "parse.y"
{ yygotominor.yy392 = OE_Restrict * 0x010101; }
#line 2278 "parse.c"
        break;
      case 71: /* refargs ::= refargs refarg */
#line 299 "parse.y"
{ yygotominor.yy392 = (yymsp[-1].minor.yy392 & ~yymsp[0].minor.yy207.mask) | yymsp[0].minor.yy207.value; }
#line 2283 "parse.c"
        break;
      case 72: /* refarg ::= MATCH nm */
#line 301 "parse.y"
{ yygotominor.yy207.value = 0;     yygotominor.yy207.mask = 0x000000; }
#line 2288 "parse.c"
        break;
      case 73: /* refarg ::= ON DELETE refact */
#line 302 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392;     yygotominor.yy207.mask = 0x0000ff; }
#line 2293 "parse.c"
        break;
      case 74: /* refarg ::= ON UPDATE refact */
#line 303 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392<<8;  yygotominor.yy207.mask = 0x00ff00; }
#line 2298 "parse.c"
        break;
      case 75: /* refarg ::= ON INSERT refact */
#line 304 "parse.y"
{ yygotominor.yy207.value = yymsp[0].minor.yy392<<16; yygotominor.yy207.mask = 0xff0000; }
#line 2303 "parse.c"
        break;
      case 76: /* refact ::= SET NULL */
#line 306 "parse.y"
{ yygotominor.yy392 = OE_SetNull; }
#line 2308 "parse.c"
        break;
      case 77: /* refact ::= SET DEFAULT */
#line 307 "parse.y"
{ yygotominor.yy392 = OE_SetDflt; }
#line 2313 "parse.c"
        break;
      case 78: /* refact ::= CASCADE */
#line 308 "parse.y"
{ yygotominor.yy392 = OE_Cascade; }
#line 2318 "parse.c"
        break;
      case 79: /* refact ::= RESTRICT */
#line 309 "parse.y"
{ yygotominor.yy392 = OE_Restrict; }
#line 2323 "parse.c"
        break;
      case 80: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
      case 81: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
      case 96: /* defer_subclause_opt ::= defer_subclause */
      case 98: /* onconf ::= ON CONFLICT resolvetype */
      case 100: /* orconf ::= OR resolvetype */
      case 101: /* resolvetype ::= raisetype */
      case 173: /* insert_cmd ::= INSERT orconf */
#line 311 "parse.y"
{yygotominor.yy392 = yymsp[0].minor.yy392;}
#line 2334 "parse.c"
        break;
      case 85: /* conslist_opt ::= */
#line 321 "parse.y"
{yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;}
#line 2339 "parse.c"
        break;
      case 86: /* conslist_opt ::= COMMA conslist */
#line 322 "parse.y"
{yygotominor.yy0 = yymsp[-1].minor.yy0;}
#line 2344 "parse.c"
        break;
      case 91: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */
#line 328 "parse.y"
{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy442,yymsp[0].minor.yy392,yymsp[-2].minor.yy392,0);}
#line 2349 "parse.c"
        break;
      case 92: /* tcons ::= UNIQUE LP idxlist RP onconf */
#line 330 "parse.y"
{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy442,yymsp[0].minor.yy392,0,0,0,0);}
#line 2354 "parse.c"
        break;
      case 93: /* tcons ::= CHECK LP expr RP onconf */
#line 331 "parse.y"
{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy122);}
#line 2359 "parse.c"
        break;
      case 94: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */
#line 333 "parse.y"
{
    sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy442, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy442, yymsp[-1].minor.yy392);
    sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy392);
}
#line 2367 "parse.c"
        break;
      case 97: /* onconf ::= */
      case 99: /* orconf ::= */
#line 347 "parse.y"
{yygotominor.yy392 = OE_Default;}
#line 2373 "parse.c"
        break;
      case 102: /* resolvetype ::= IGNORE */
#line 352 "parse.y"
{yygotominor.yy392 = OE_Ignore;}
#line 2378 "parse.c"
        break;
      case 103: /* resolvetype ::= REPLACE */
      case 174: /* insert_cmd ::= REPLACE */
#line 353 "parse.y"
{yygotominor.yy392 = OE_Replace;}
#line 2384 "parse.c"
        break;
      case 104: /* cmd ::= DROP TABLE ifexists fullname */
#line 357 "parse.y"
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy347, 0, yymsp[-1].minor.yy392);
}
#line 2391 "parse.c"
        break;
      case 107: /* cmd ::= CREATE temp VIEW ifnotexists nm dbnm AS select */
#line 367 "parse.y"
{
  sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy159, yymsp[-6].minor.yy392, yymsp[-4].minor.yy392);
}
#line 2398 "parse.c"
        break;
      case 108: /* cmd ::= DROP VIEW ifexists fullname */
#line 370 "parse.y"
{
  sqlite3DropTable(pParse, yymsp[0].minor.yy347, 1, yymsp[-1].minor.yy392);
}
#line 2405 "parse.c"
        break;
      case 109: /* cmd ::= select */
#line 377 "parse.y"
{
  SelectDest dest = {SRT_Output, 0, 0, 0, 0};
  sqlite3Select(pParse, yymsp[0].minor.yy159, &dest);
  sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159);
}
#line 2414 "parse.c"
        break;
      case 110: /* select ::= oneselect */
#line 388 "parse.y"
{yygotominor.yy159 = yymsp[0].minor.yy159;}
#line 2419 "parse.c"
        break;
      case 111: /* select ::= select multiselect_op oneselect */
#line 390 "parse.y"
{
  if( yymsp[0].minor.yy159 ){
    yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392;
    yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159;
  }else{
    sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159);
  }
  yygotominor.yy159 = yymsp[0].minor.yy159;
}
#line 2432 "parse.c"
        break;
      case 113: /* multiselect_op ::= UNION ALL */
#line 401 "parse.y"
{yygotominor.yy392 = TK_ALL;}
#line 2437 "parse.c"
        break;
      case 115: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
#line 405 "parse.y"
{
  yygotominor.yy159 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy442,yymsp[-5].minor.yy347,yymsp[-4].minor.yy122,yymsp[-3].minor.yy442,yymsp[-2].minor.yy122,yymsp[-1].minor.yy442,yymsp[-7].minor.yy392,yymsp[0].minor.yy64.pLimit,yymsp[0].minor.yy64.pOffset);
}
#line 2444 "parse.c"
        break;
      case 119: /* sclp ::= selcollist COMMA */
      case 245: /* idxlist_opt ::= LP idxlist RP */
#line 426 "parse.y"
{yygotominor.yy442 = yymsp[-1].minor.yy442;}
#line 2450 "parse.c"
        break;
      case 120: /* sclp ::= */
      case 148: /* orderby_opt ::= */
      case 156: /* groupby_opt ::= */
      case 238: /* exprlist ::= */
      case 244: /* idxlist_opt ::= */
#line 427 "parse.y"
{yygotominor.yy442 = 0;}
#line 2459 "parse.c"
        break;
      case 121: /* selcollist ::= sclp expr as */
#line 428 "parse.y"
{
   yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[-1].minor.yy122,yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
#line 2466 "parse.c"
        break;
      case 122: /* selcollist ::= sclp STAR */
#line 431 "parse.y"
{
  Expr *p = sqlite3PExpr(pParse, TK_ALL, 0, 0, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy442, p, 0);
}
#line 2474 "parse.c"
        break;
      case 123: /* selcollist ::= sclp nm DOT STAR */
#line 435 "parse.y"
{
  Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0);
  Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442, pDot, 0);
}
#line 2484 "parse.c"
        break;
      case 126: /* as ::= */
#line 448 "parse.y"
{yygotominor.yy0.n = 0;}
#line 2489 "parse.c"
        break;
      case 127: /* from ::= */
#line 460 "parse.y"
{yygotominor.yy347 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy347));}
#line 2494 "parse.c"
        break;
      case 128: /* from ::= FROM seltablist */
#line 461 "parse.y"
{
  yygotominor.yy347 = yymsp[0].minor.yy347;
  sqlite3SrcListShiftJoinType(yygotominor.yy347);
}
#line 2502 "parse.c"
        break;
      case 129: /* stl_prefix ::= seltablist joinop */
#line 469 "parse.y"
{
   yygotominor.yy347 = yymsp[-1].minor.yy347;
   if( yygotominor.yy347 && yygotominor.yy347->nSrc>0 ) yygotominor.yy347->a[yygotominor.yy347->nSrc-1].jointype = (u8)yymsp[0].minor.yy392;
}
#line 2510 "parse.c"
        break;
      case 130: /* stl_prefix ::= */
#line 473 "parse.y"
{yygotominor.yy347 = 0;}
#line 2515 "parse.c"
        break;
      case 131: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
#line 474 "parse.y"
{
  yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
  sqlite3SrcListIndexedBy(pParse, yygotominor.yy347, &yymsp[-2].minor.yy0);
}
#line 2523 "parse.c"
        break;
      case 132: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
#line 480 "parse.y"
{
    yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy159,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
  }
#line 2530 "parse.c"
        break;
      case 133: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
#line 484 "parse.y"
{
    if( yymsp[-6].minor.yy347==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy122==0 && yymsp[0].minor.yy180==0 ){
      yygotominor.yy347 = yymsp[-4].minor.yy347;
    }else{
      Select *pSubquery;
      sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy347);
      pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy347,0,0,0,0,0,0,0);
      yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy122,yymsp[0].minor.yy180);
    }
  }
#line 2544 "parse.c"
        break;
      case 134: /* dbnm ::= */
      case 143: /* indexed_opt ::= */
#line 509 "parse.y"
{yygotominor.yy0.z=0; yygotominor.yy0.n=0;}
#line 2550 "parse.c"
        break;
      case 136: /* fullname ::= nm dbnm */
#line 514 "parse.y"
{yygotominor.yy347 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);}
#line 2555 "parse.c"
        break;
      case 137: /* joinop ::= COMMA|JOIN */
#line 518 "parse.y"
{ yygotominor.yy392 = JT_INNER; }
#line 2560 "parse.c"
        break;
      case 138: /* joinop ::= JOIN_KW JOIN */
#line 519 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); }
#line 2565 "parse.c"
        break;
      case 139: /* joinop ::= JOIN_KW nm JOIN */
#line 520 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); }
#line 2570 "parse.c"
        break;
      case 140: /* joinop ::= JOIN_KW nm nm JOIN */
#line 522 "parse.y"
{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); }
#line 2575 "parse.c"
        break;
      case 141: /* on_opt ::= ON expr */
      case 152: /* sortitem ::= expr */
      case 159: /* having_opt ::= HAVING expr */
      case 166: /* where_opt ::= WHERE expr */
      case 181: /* expr ::= term */
      case 209: /* escape ::= ESCAPE expr */
      case 233: /* case_else ::= ELSE expr */
      case 235: /* case_operand ::= expr */
#line 526 "parse.y"
{yygotominor.yy122 = yymsp[0].minor.yy122;}
#line 2587 "parse.c"
        break;
      case 142: /* on_opt ::= */
      case 158: /* having_opt ::= */
      case 165: /* where_opt ::= */
      case 210: /* escape ::= */
      case 234: /* case_else ::= */
      case 236: /* case_operand ::= */
#line 527 "parse.y"
{yygotominor.yy122 = 0;}
#line 2597 "parse.c"
        break;
      case 145: /* indexed_opt ::= NOT INDEXED */
#line 542 "parse.y"
{yygotominor.yy0.z=0; yygotominor.yy0.n=1;}
#line 2602 "parse.c"
        break;
      case 146: /* using_opt ::= USING LP inscollist RP */
      case 178: /* inscollist_opt ::= LP inscollist RP */
#line 546 "parse.y"
{yygotominor.yy180 = yymsp[-1].minor.yy180;}
#line 2608 "parse.c"
        break;
      case 147: /* using_opt ::= */
      case 177: /* inscollist_opt ::= */
#line 547 "parse.y"
{yygotominor.yy180 = 0;}
#line 2614 "parse.c"
        break;
      case 149: /* orderby_opt ::= ORDER BY sortlist */
      case 157: /* groupby_opt ::= GROUP BY nexprlist */
      case 237: /* exprlist ::= nexprlist */
#line 558 "parse.y"
{yygotominor.yy442 = yymsp[0].minor.yy442;}
#line 2621 "parse.c"
        break;
      case 150: /* sortlist ::= sortlist COMMA sortitem sortorder */
#line 559 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442,yymsp[-1].minor.yy122,0);
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 2629 "parse.c"
        break;
      case 151: /* sortlist ::= sortitem sortorder */
#line 563 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy122,0);
  if( yygotominor.yy442 && yygotominor.yy442->a ) yygotominor.yy442->a[0].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 2637 "parse.c"
        break;
      case 153: /* sortorder ::= ASC */
      case 155: /* sortorder ::= */
#line 571 "parse.y"
{yygotominor.yy392 = SQLITE_SO_ASC;}
#line 2643 "parse.c"
        break;
      case 154: /* sortorder ::= DESC */
#line 572 "parse.y"
{yygotominor.yy392 = SQLITE_SO_DESC;}
#line 2648 "parse.c"
        break;
      case 160: /* limit_opt ::= */
#line 598 "parse.y"
{yygotominor.yy64.pLimit = 0; yygotominor.yy64.pOffset = 0;}
#line 2653 "parse.c"
        break;
      case 161: /* limit_opt ::= LIMIT expr */
#line 599 "parse.y"
{yygotominor.yy64.pLimit = yymsp[0].minor.yy122; yygotominor.yy64.pOffset = 0;}
#line 2658 "parse.c"
        break;
      case 162: /* limit_opt ::= LIMIT expr OFFSET expr */
#line 601 "parse.y"
{yygotominor.yy64.pLimit = yymsp[-2].minor.yy122; yygotominor.yy64.pOffset = yymsp[0].minor.yy122;}
#line 2663 "parse.c"
        break;
      case 163: /* limit_opt ::= LIMIT expr COMMA expr */
#line 603 "parse.y"
{yygotominor.yy64.pOffset = yymsp[-2].minor.yy122; yygotominor.yy64.pLimit = yymsp[0].minor.yy122;}
#line 2668 "parse.c"
        break;
      case 164: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */
#line 616 "parse.y"
{
  sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy347, &yymsp[-1].minor.yy0);
  sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy347,yymsp[0].minor.yy122);
}
#line 2676 "parse.c"
        break;
      case 167: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */
#line 639 "parse.y"
{
  sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy347, &yymsp[-3].minor.yy0);
  sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy442,"set list"); 
  sqlite3Update(pParse,yymsp[-4].minor.yy347,yymsp[-1].minor.yy442,yymsp[0].minor.yy122,yymsp[-5].minor.yy392);
}
#line 2685 "parse.c"
        break;
      case 168: /* setlist ::= setlist COMMA nm EQ expr */
#line 650 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442,yymsp[0].minor.yy122,&yymsp[-2].minor.yy0);}
#line 2690 "parse.c"
        break;
      case 169: /* setlist ::= nm EQ expr */
#line 652 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy122,&yymsp[-2].minor.yy0);}
#line 2695 "parse.c"
        break;
      case 170: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */
#line 658 "parse.y"
{sqlite3Insert(pParse, yymsp[-5].minor.yy347, yymsp[-1].minor.yy442, 0, yymsp[-4].minor.yy180, yymsp[-7].minor.yy392);}
#line 2700 "parse.c"
        break;
      case 171: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */
#line 660 "parse.y"
{sqlite3Insert(pParse, yymsp[-2].minor.yy347, 0, yymsp[0].minor.yy159, yymsp[-1].minor.yy180, yymsp[-4].minor.yy392);}
#line 2705 "parse.c"
        break;
      case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */
#line 662 "parse.y"
{sqlite3Insert(pParse, yymsp[-3].minor.yy347, 0, 0, yymsp[-2].minor.yy180, yymsp[-5].minor.yy392);}
#line 2710 "parse.c"
        break;
      case 175: /* itemlist ::= itemlist COMMA expr */
      case 239: /* nexprlist ::= nexprlist COMMA expr */
#line 673 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[0].minor.yy122,0);}
#line 2716 "parse.c"
        break;
      case 176: /* itemlist ::= expr */
      case 240: /* nexprlist ::= expr */
#line 675 "parse.y"
{yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy122,0);}
#line 2722 "parse.c"
        break;
      case 179: /* inscollist ::= inscollist COMMA nm */
#line 685 "parse.y"
{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy180,&yymsp[0].minor.yy0);}
#line 2727 "parse.c"
        break;
      case 180: /* inscollist ::= nm */
#line 687 "parse.y"
{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);}
#line 2732 "parse.c"
        break;
      case 182: /* expr ::= LP expr RP */
#line 698 "parse.y"
{yygotominor.yy122 = yymsp[-1].minor.yy122; sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); }
#line 2737 "parse.c"
        break;
      case 183: /* term ::= NULL */
      case 188: /* term ::= INTEGER|FLOAT|BLOB */
      case 189: /* term ::= STRING */
#line 699 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[0].major, 0, 0, &yymsp[0].minor.yy0);}
#line 2744 "parse.c"
        break;
      case 184: /* expr ::= ID */
      case 185: /* expr ::= JOIN_KW */
#line 700 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);}
#line 2750 "parse.c"
        break;
      case 186: /* expr ::= nm DOT nm */
#line 702 "parse.y"
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0);
}
#line 2759 "parse.c"
        break;
      case 187: /* expr ::= nm DOT nm DOT nm */
#line 707 "parse.y"
{
  Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0);
  Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0);
  Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0);
  Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0);
}
#line 2770 "parse.c"
        break;
      case 190: /* expr ::= REGISTER */
#line 716 "parse.y"
{yygotominor.yy122 = sqlite3RegisterExpr(pParse, &yymsp[0].minor.yy0);}
#line 2775 "parse.c"
        break;
      case 191: /* expr ::= VARIABLE */
#line 717 "parse.y"
{
  Token *pToken = &yymsp[0].minor.yy0;
  Expr *pExpr = yygotominor.yy122 = sqlite3PExpr(pParse, TK_VARIABLE, 0, 0, pToken);
  sqlite3ExprAssignVarNumber(pParse, pExpr);
}
#line 2784 "parse.c"
        break;
      case 192: /* expr ::= expr COLLATE ids */
#line 722 "parse.y"
{
  yygotominor.yy122 = sqlite3ExprSetColl(pParse, yymsp[-2].minor.yy122, &yymsp[0].minor.yy0);
}
#line 2791 "parse.c"
        break;
      case 193: /* expr ::= CAST LP expr AS typetoken RP */
#line 726 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy122, 0, &yymsp[-1].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0);
}
#line 2799 "parse.c"
        break;
      case 194: /* expr ::= ID LP distinct exprlist RP */
#line 731 "parse.y"
{
  if( yymsp[-1].minor.yy442 && yymsp[-1].minor.yy442->nExpr>SQLITE_MAX_FUNCTION_ARG ){
    sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0);
  }
  yygotominor.yy122 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy442, &yymsp[-4].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0);
  if( yymsp[-2].minor.yy392 && yygotominor.yy122 ){
    yygotominor.yy122->flags |= EP_Distinct;
  }
}
#line 2813 "parse.c"
        break;
      case 195: /* expr ::= ID LP STAR RP */
#line 741 "parse.y"
{
  yygotominor.yy122 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
}
#line 2821 "parse.c"
        break;
      case 196: /* term ::= CTIME_KW */
#line 745 "parse.y"
{
  /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are
  ** treated as functions that return constants */
  yygotominor.yy122 = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->op = TK_CONST_FUNC;  
    yygotominor.yy122->span = yymsp[0].minor.yy0;
  }
}
#line 2834 "parse.c"
        break;
      case 197: /* expr ::= expr AND expr */
      case 198: /* expr ::= expr OR expr */
      case 199: /* expr ::= expr LT|GT|GE|LE expr */
      case 200: /* expr ::= expr EQ|NE expr */
      case 201: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
      case 202: /* expr ::= expr PLUS|MINUS expr */
      case 203: /* expr ::= expr STAR|SLASH|REM expr */
      case 204: /* expr ::= expr CONCAT expr */
#line 754 "parse.y"
{yygotominor.yy122 = sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy122,yymsp[0].minor.yy122,0);}
#line 2846 "parse.c"
        break;
      case 205: /* likeop ::= LIKE_KW */
      case 207: /* likeop ::= MATCH */
#line 766 "parse.y"
{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 0;}
#line 2852 "parse.c"
        break;
      case 206: /* likeop ::= NOT LIKE_KW */
      case 208: /* likeop ::= NOT MATCH */
#line 767 "parse.y"
{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.not = 1;}
#line 2858 "parse.c"
        break;
      case 211: /* expr ::= expr likeop expr escape */
#line 774 "parse.y"
{
  ExprList *pList;
  pList = sqlite3ExprListAppend(pParse,0, yymsp[-1].minor.yy122, 0);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[-3].minor.yy122, 0);
  if( yymsp[0].minor.yy122 ){
    pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy122, 0);
  }
  yygotominor.yy122 = sqlite3ExprFunction(pParse, pList, &yymsp[-2].minor.yy318.eOperator);
  if( yymsp[-2].minor.yy318.not ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122, &yymsp[-3].minor.yy122->span, &yymsp[-1].minor.yy122->span);
  if( yygotominor.yy122 ) yygotominor.yy122->flags |= EP_InfixFunc;
}
#line 2874 "parse.c"
        break;
      case 212: /* expr ::= expr ISNULL|NOTNULL */
#line 787 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[0].major, yymsp[-1].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2882 "parse.c"
        break;
      case 213: /* expr ::= expr IS NULL */
#line 791 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_ISNULL, yymsp[-2].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2890 "parse.c"
        break;
      case 214: /* expr ::= expr NOT NULL */
#line 795 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-2].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2898 "parse.c"
        break;
      case 215: /* expr ::= expr IS NOT NULL */
#line 799 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOTNULL, yymsp[-3].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy122->span,&yymsp[0].minor.yy0);
}
#line 2906 "parse.c"
        break;
      case 216: /* expr ::= NOT expr */
      case 217: /* expr ::= BITNOT expr */
#line 803 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2915 "parse.c"
        break;
      case 218: /* expr ::= MINUS expr */
#line 811 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2923 "parse.c"
        break;
      case 219: /* expr ::= PLUS expr */
#line 815 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_UPLUS, yymsp[0].minor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy122->span);
}
#line 2931 "parse.c"
        break;
      case 222: /* expr ::= expr between_op expr AND expr */
#line 822 "parse.y"
{
  ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy122, 0);
  pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy122, 0);
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy122, 0, 0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->pList = pList;
  }else{
    sqlite3ExprListDelete(pParse->db, pList);
  } 
  if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
  sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy122->span);
}
#line 2947 "parse.c"
        break;
      case 225: /* expr ::= expr in_op LP exprlist RP */
#line 838 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pList = yymsp[-1].minor.yy442;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy442);
    }
    if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy0);
  }
#line 2962 "parse.c"
        break;
      case 226: /* expr ::= LP select RP */
#line 849 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
  }
#line 2976 "parse.c"
        break;
      case 227: /* expr ::= expr in_op LP select RP */
#line 859 "parse.y"
{
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
    if( yymsp[-3].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-4].minor.yy122->span,&yymsp[0].minor.yy0);
  }
#line 2991 "parse.c"
        break;
      case 228: /* expr ::= expr in_op nm dbnm */
#line 870 "parse.y"
{
    SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);
    yygotominor.yy122 = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy122, 0, 0);
    if( yygotominor.yy122 ){
      yygotominor.yy122->pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0);
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SrcListDelete(pParse->db, pSrc);
    }
    if( yymsp[-2].minor.yy392 ) yygotominor.yy122 = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy122, 0, 0);
    sqlite3ExprSpan(yygotominor.yy122,&yymsp[-3].minor.yy122->span,yymsp[0].minor.yy0.z?&yymsp[0].minor.yy0:&yymsp[-1].minor.yy0);
  }
#line 3007 "parse.c"
        break;
      case 229: /* expr ::= EXISTS LP select RP */
#line 882 "parse.y"
{
    Expr *p = yygotominor.yy122 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0);
    if( p ){
      p->pSelect = yymsp[-1].minor.yy159;
      sqlite3ExprSpan(p,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0);
      sqlite3ExprSetHeight(pParse, yygotominor.yy122);
    }else{
      sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159);
    }
  }
#line 3021 "parse.c"
        break;
      case 230: /* expr ::= CASE case_operand case_exprlist case_else END */
#line 895 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, 0);
  if( yygotominor.yy122 ){
    yygotominor.yy122->pList = yymsp[-2].minor.yy442;
    sqlite3ExprSetHeight(pParse, yygotominor.yy122);
  }else{
    sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy442);
  }
  sqlite3ExprSpan(yygotominor.yy122, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3035 "parse.c"
        break;
      case 231: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
#line 907 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, yymsp[-2].minor.yy122, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy122, 0);
}
#line 3043 "parse.c"
        break;
      case 232: /* case_exprlist ::= WHEN expr THEN expr */
#line 911 "parse.y"
{
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy122, 0);
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy122, 0);
}
#line 3051 "parse.c"
        break;
      case 241: /* cmd ::= CREATE uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */
#line 940 "parse.y"
{
  sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, 
                     sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy442, yymsp[-9].minor.yy392,
                      &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy392);
}
#line 3060 "parse.c"
        break;
      case 242: /* uniqueflag ::= UNIQUE */
      case 289: /* raisetype ::= ABORT */
#line 947 "parse.y"
{yygotominor.yy392 = OE_Abort;}
#line 3066 "parse.c"
        break;
      case 243: /* uniqueflag ::= */
#line 948 "parse.y"
{yygotominor.yy392 = OE_None;}
#line 3071 "parse.c"
        break;
      case 246: /* idxlist ::= idxlist COMMA nm collate sortorder */
#line 957 "parse.y"
{
  Expr *p = 0;
  if( yymsp[-1].minor.yy0.n>0 ){
    p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
    sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0);
  }
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, p, &yymsp[-2].minor.yy0);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 3085 "parse.c"
        break;
      case 247: /* idxlist ::= nm collate sortorder */
#line 967 "parse.y"
{
  Expr *p = 0;
  if( yymsp[-1].minor.yy0.n>0 ){
    p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
    sqlite3ExprSetColl(pParse, p, &yymsp[-1].minor.yy0);
  }
  yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, p, &yymsp[-2].minor.yy0);
  sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index");
  if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392;
}
#line 3099 "parse.c"
        break;
      case 248: /* collate ::= */
#line 979 "parse.y"
{yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;}
#line 3104 "parse.c"
        break;
      case 250: /* cmd ::= DROP INDEX ifexists fullname */
#line 985 "parse.y"
{sqlite3DropIndex(pParse, yymsp[0].minor.yy347, yymsp[-1].minor.yy392);}
#line 3109 "parse.c"
        break;
      case 251: /* cmd ::= VACUUM */
      case 252: /* cmd ::= VACUUM nm */
#line 991 "parse.y"
{sqlite3Vacuum(pParse);}
#line 3115 "parse.c"
        break;
      case 253: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
      case 254: /* cmd ::= PRAGMA nm dbnm EQ ON */
      case 255: /* cmd ::= PRAGMA nm dbnm EQ DELETE */
#line 1000 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
#line 3122 "parse.c"
        break;
      case 256: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
#line 1003 "parse.y"
{
  sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);
}
#line 3129 "parse.c"
        break;
      case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
#line 1006 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
#line 3134 "parse.c"
        break;
      case 258: /* cmd ::= PRAGMA nm dbnm */
#line 1007 "parse.y"
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
#line 3139 "parse.c"
        break;
      case 266: /* cmd ::= CREATE trigger_decl BEGIN trigger_cmd_list END */
#line 1022 "parse.y"
{
  Token all;
  all.z = yymsp[-3].minor.yy0.z;
  all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
  sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy327, &all);
}
#line 3149 "parse.c"
        break;
      case 267: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
#line 1031 "parse.y"
{
  sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy392, yymsp[-4].minor.yy410.a, yymsp[-4].minor.yy410.b, yymsp[-2].minor.yy347, yymsp[0].minor.yy122, yymsp[-10].minor.yy392, yymsp[-8].minor.yy392);
  yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0);
}
#line 3157 "parse.c"
        break;
      case 268: /* trigger_time ::= BEFORE */
      case 271: /* trigger_time ::= */
#line 1037 "parse.y"
{ yygotominor.yy392 = TK_BEFORE; }
#line 3163 "parse.c"
        break;
      case 269: /* trigger_time ::= AFTER */
#line 1038 "parse.y"
{ yygotominor.yy392 = TK_AFTER;  }
#line 3168 "parse.c"
        break;
      case 270: /* trigger_time ::= INSTEAD OF */
#line 1039 "parse.y"
{ yygotominor.yy392 = TK_INSTEAD;}
#line 3173 "parse.c"
        break;
      case 272: /* trigger_event ::= DELETE|INSERT */
      case 273: /* trigger_event ::= UPDATE */
#line 1044 "parse.y"
{yygotominor.yy410.a = yymsp[0].major; yygotominor.yy410.b = 0;}
#line 3179 "parse.c"
        break;
      case 274: /* trigger_event ::= UPDATE OF inscollist */
#line 1046 "parse.y"
{yygotominor.yy410.a = TK_UPDATE; yygotominor.yy410.b = yymsp[0].minor.yy180;}
#line 3184 "parse.c"
        break;
      case 277: /* when_clause ::= */
      case 294: /* key_opt ::= */
#line 1053 "parse.y"
{ yygotominor.yy122 = 0; }
#line 3190 "parse.c"
        break;
      case 278: /* when_clause ::= WHEN expr */
      case 295: /* key_opt ::= KEY expr */
#line 1054 "parse.y"
{ yygotominor.yy122 = yymsp[0].minor.yy122; }
#line 3196 "parse.c"
        break;
      case 279: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
#line 1058 "parse.y"
{
/*
  if( yymsp[-2].minor.yy327 ){
    yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327;
  }else{
    yymsp[-2].minor.yy327 = yymsp[-1].minor.yy327;
  }
*/
  assert( yymsp[-2].minor.yy327!=0 );
  yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327;
  yymsp[-2].minor.yy327->pLast = yymsp[-1].minor.yy327;
  yygotominor.yy327 = yymsp[-2].minor.yy327;
}
#line 3213 "parse.c"
        break;
      case 280: /* trigger_cmd_list ::= trigger_cmd SEMI */
#line 1071 "parse.y"
{ 
  /* if( yymsp[-1].minor.yy327 ) */
  assert( yymsp[-1].minor.yy327!=0 );
  yymsp[-1].minor.yy327->pLast = yymsp[-1].minor.yy327;
  yygotominor.yy327 = yymsp[-1].minor.yy327;
}
#line 3223 "parse.c"
        break;
      case 281: /* trigger_cmd ::= UPDATE orconf nm SET setlist where_opt */
#line 1082 "parse.y"
{ yygotominor.yy327 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy442, yymsp[0].minor.yy122, yymsp[-4].minor.yy392); }
#line 3228 "parse.c"
        break;
      case 282: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt VALUES LP itemlist RP */
#line 1087 "parse.y"
{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy180, yymsp[-1].minor.yy442, 0, yymsp[-7].minor.yy392);}
#line 3233 "parse.c"
        break;
      case 283: /* trigger_cmd ::= insert_cmd INTO nm inscollist_opt select */
#line 1090 "parse.y"
{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, 0, yymsp[0].minor.yy159, yymsp[-4].minor.yy392);}
#line 3238 "parse.c"
        break;
      case 284: /* trigger_cmd ::= DELETE FROM nm where_opt */
#line 1094 "parse.y"
{yygotominor.yy327 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-1].minor.yy0, yymsp[0].minor.yy122);}
#line 3243 "parse.c"
        break;
      case 285: /* trigger_cmd ::= select */
#line 1097 "parse.y"
{yygotominor.yy327 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy159); }
#line 3248 "parse.c"
        break;
      case 286: /* expr ::= RAISE LP IGNORE RP */
#line 1100 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); 
  if( yygotominor.yy122 ){
    yygotominor.yy122->iColumn = OE_Ignore;
    sqlite3ExprSpan(yygotominor.yy122, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
  }
}
#line 3259 "parse.c"
        break;
      case 287: /* expr ::= RAISE LP raisetype COMMA nm RP */
#line 1107 "parse.y"
{
  yygotominor.yy122 = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); 
  if( yygotominor.yy122 ) {
    yygotominor.yy122->iColumn = yymsp[-3].minor.yy392;
    sqlite3ExprSpan(yygotominor.yy122, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0);
  }
}
#line 3270 "parse.c"
        break;
      case 288: /* raisetype ::= ROLLBACK */
#line 1117 "parse.y"
{yygotominor.yy392 = OE_Rollback;}
#line 3275 "parse.c"
        break;
      case 290: /* raisetype ::= FAIL */
#line 1119 "parse.y"
{yygotominor.yy392 = OE_Fail;}
#line 3280 "parse.c"
        break;
      case 291: /* cmd ::= DROP TRIGGER ifexists fullname */
#line 1124 "parse.y"
{
  sqlite3DropTrigger(pParse,yymsp[0].minor.yy347,yymsp[-1].minor.yy392);
}
#line 3287 "parse.c"
        break;
      case 292: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
#line 1131 "parse.y"
{
  sqlite3Attach(pParse, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, yymsp[0].minor.yy122);
}
#line 3294 "parse.c"
        break;
      case 293: /* cmd ::= DETACH database_kw_opt expr */
#line 1134 "parse.y"
{
  sqlite3Detach(pParse, yymsp[0].minor.yy122);
}
#line 3301 "parse.c"
        break;
      case 298: /* cmd ::= REINDEX */
#line 1149 "parse.y"
{sqlite3Reindex(pParse, 0, 0);}
#line 3306 "parse.c"
        break;
      case 299: /* cmd ::= REINDEX nm dbnm */
#line 1150 "parse.y"
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
#line 3311 "parse.c"
        break;
      case 300: /* cmd ::= ANALYZE */
#line 1155 "parse.y"
{sqlite3Analyze(pParse, 0, 0);}
#line 3316 "parse.c"
        break;
      case 301: /* cmd ::= ANALYZE nm dbnm */
#line 1156 "parse.y"
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
#line 3321 "parse.c"
        break;
      case 302: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
#line 1161 "parse.y"
{
  sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy347,&yymsp[0].minor.yy0);
}
#line 3328 "parse.c"
        break;
      case 303: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */
#line 1164 "parse.y"
{
  sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0);
}
#line 3335 "parse.c"
        break;
      case 304: /* add_column_fullname ::= fullname */
#line 1167 "parse.y"
{
  sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy347);
}
#line 3342 "parse.c"
        break;
      case 307: /* cmd ::= create_vtab */
#line 1176 "parse.y"
{sqlite3VtabFinishParse(pParse,0);}
#line 3347 "parse.c"
        break;
      case 308: /* cmd ::= create_vtab LP vtabarglist RP */
#line 1177 "parse.y"
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
#line 3352 "parse.c"
        break;
      case 309: /* create_vtab ::= CREATE VIRTUAL TABLE nm dbnm USING nm */
#line 1178 "parse.y"
{
    sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3359 "parse.c"
        break;
      case 312: /* vtabarg ::= */
#line 1183 "parse.y"
{sqlite3VtabArgInit(pParse);}
#line 3364 "parse.c"
        break;
      case 314: /* vtabargtoken ::= ANY */
      case 315: /* vtabargtoken ::= lp anylist RP */
      case 316: /* lp ::= LP */
      case 318: /* anylist ::= anylist ANY */
#line 1185 "parse.y"
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
#line 3372 "parse.c"
        break;
  };
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  yypParser->yyidx -= yysize;
  yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
  if( yyact < YYNSTATE ){
#ifdef NDEBUG
    /* If we are not debugging and the reduce action popped at least
    ** one element off the stack, then we can push the new element back
    ** onto the stack here, and skip the stack overflow test in yy_shift().
    ** That gives a significant speed improvement. */
    if( yysize ){
      yypParser->yyidx++;
      yymsp -= yysize-1;
      yymsp->stateno = yyact;
      yymsp->major = yygoto;
      yymsp->minor = yygotominor;
    }else
#endif
    {
      yy_shift(yypParser,yyact,yygoto,&yygotominor);
    }
  }else{
    assert( yyact == YYNSTATE + YYNRULE + 1 );
    yy_accept(yypParser);
  }
}

/*
** The following code executes when the parse fails
*/
static void yy_parse_failed(
  yyParser *yypParser           /* The parser */
){
  sqlite3ParserARG_FETCH;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser fails */
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/*
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
  yyParser *yypParser,           /* The parser */
  int yymajor,                   /* The major type of the error token */
  YYMINORTYPE yyminor            /* The minor type of the error token */
){
  sqlite3ParserARG_FETCH;
#define TOKEN (yyminor.yy0)
#line 34 "parse.y"

  UNUSED_PARAMETER(yymajor);  /* Silence some compiler warnings */
  assert( TOKEN.z[0] );  /* The tokenizer always gives us a token */
  sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN);
  pParse->parseError = 1;
#line 3436 "parse.c"
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
  sqlite3ParserARG_FETCH;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser accepts */
  sqlite3ParserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
** "sqlite3ParserAlloc" which describes the current state of the parser.
** The second argument is the major token number.  The third is
** the minor token.  The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
void sqlite3Parser(
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
  sqlite3ParserTOKENTYPE yyminor       /* The value for the token */
  sqlite3ParserARG_PDECL               /* Optional %extra_argument parameter */
){
  YYMINORTYPE yyminorunion;
  int yyact;            /* The parser action. */
  int yyendofinput;     /* True if we are at the end of input */
#ifdef YYERRORSYMBOL
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
#endif
  yyParser *yypParser;  /* The parser */

  /* (re)initialize the parser, if necessary */
  yypParser = (yyParser*)yyp;
  if( yypParser->yyidx<0 ){
#if YYSTACKDEPTH<=0
    if( yypParser->yystksz <=0 ){
      /*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
      yyminorunion = yyzerominor;
      yyStackOverflow(yypParser, &yyminorunion);
      return;
    }
#endif
    yypParser->yyidx = 0;
    yypParser->yyerrcnt = -1;
    yypParser->yystack[0].stateno = 0;
    yypParser->yystack[0].major = 0;
  }
  yyminorunion.yy0 = yyminor;
  yyendofinput = (yymajor==0);
  sqlite3ParserARG_STORE;

#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
  }
#endif

  do{
    yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
    if( yyact<YYNSTATE ){
      assert( !yyendofinput );  /* Impossible to shift the $ token */
      yy_shift(yypParser,yyact,yymajor,&yyminorunion);
      yypParser->yyerrcnt--;
      yymajor = YYNOCODE;
    }else if( yyact < YYNSTATE + YYNRULE ){
      yy_reduce(yypParser,yyact-YYNSTATE);
    }else{
      assert( yyact == YY_ERROR_ACTION );
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminorunion);
      }
      yymx = yypParser->yystack[yypParser->yyidx].major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
        yymajor = YYNOCODE;
      }else{
         while(
          yypParser->yyidx >= 0 &&
          yymx != YYERRORSYMBOL &&
          (yyact = yy_find_reduce_action(
                        yypParser->yystack[yypParser->yyidx].stateno,
                        YYERRORSYMBOL)) >= YYNSTATE
        ){
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yyidx < 0 || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          YYMINORTYPE u2;
          u2.YYERRSYMDT = 0;
          yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor,yyminorunion);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
      }
      yymajor = YYNOCODE;
#endif
    }
  }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
  return;
}
